Bladeren bron

Add go1.7 build constraint to pubsub example

The example uses context package introduced in Go 1.7.
Gary Burd 8 jaren geleden
bovenliggende
commit
b389d5392e
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2 1
      redis/pubsub_example_test.go

+ 2 - 1
redis/pubsub_example_test.go

@@ -12,6 +12,8 @@
 // License for the specific language governing permissions and limitations
 // under the License.
 
+// +build go1.7
+
 package redis_test
 
 import (
@@ -29,7 +31,6 @@ func listenPubSubChannels(ctx context.Context, redisServerAddr string,
 	onStart func() error,
 	onMessage func(channel string, data []byte) error,
 	channels ...string) error {
-
 	// A ping is set to the server with this period to test for the health of
 	// the connection and server.
 	const healthCheckPeriod = time.Minute