Просмотр исходного кода

Add go1.7 build constraint to pubsub example

The example uses context package introduced in Go 1.7.
Gary Burd 8 лет назад
Родитель
Сommit
b389d5392e
1 измененных файлов с 2 добавлено и 1 удалено
  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