From 193e596dec49639d9e0426074676ab1e59201b3d Mon Sep 17 00:00:00 2001 From: Jean de Klerk Date: Fri, 9 Nov 2018 13:41:42 -0800 Subject: [PATCH] internal: inline context (prettier imports) Change-Id: I0a52c39c877de4d9e62419de50ed31070e69ff00 Reviewed-on: https://code-review.googlesource.com/c/35430 Reviewed-by: kokoro Reviewed-by: Eno Compton --- bigquery/benchmarks/bench.go | 3 +-- bigquery/bigquery.go | 3 +-- bigquery/dataset.go | 3 +-- bigquery/dataset_test.go | 3 +-- bigquery/examples_test.go | 3 +-- bigquery/inserter.go | 3 +-- bigquery/integration_test.go | 3 +-- bigquery/iterator.go | 3 +-- bigquery/iterator_test.go | 3 +-- bigquery/job.go | 3 +-- bigquery/load.go | 3 +-- bigquery/oc_test.go | 3 +-- bigquery/params_test.go | 3 +-- bigquery/query.go | 3 +-- bigquery/read_test.go | 3 +-- bigquery/table.go | 3 +-- bigtable/admin.go | 3 +-- bigtable/admin_test.go | 3 +-- bigtable/bigtable.go | 3 +-- bigtable/bigtable_test.go | 3 +-- bigtable/bttest/example_test.go | 3 +-- bigtable/bttest/inmem.go | 3 +-- bigtable/bttest/inmem_test.go | 3 +-- bigtable/cmd/cbt/cbt.go | 3 +-- bigtable/cmd/loadtest/loadtest.go | 3 +-- bigtable/cmd/scantest/scantest.go | 3 +-- bigtable/export_test.go | 3 +-- bigtable/go18.go | 3 +-- bigtable/internal/gax/invoke.go | 3 +-- bigtable/internal/gax/invoke_test.go | 3 +-- bigtable/retry_test.go | 3 +-- cmd/go-cloud-debug-agent/debuglet.go | 3 +-- cmd/go-cloud-debug-agent/internal/controller/client.go | 3 +-- cmd/go-cloud-debug-agent/internal/controller/client_test.go | 3 +-- container/apiv1/ListClusters_smoke_test.go | 3 +-- container/apiv1/cluster_manager_client.go | 3 +-- container/apiv1/mock_test.go | 3 +-- container/container.go | 3 +-- datastore/client.go | 3 +-- datastore/datastore.go | 3 +-- datastore/datastore_test.go | 3 +-- datastore/example_test.go | 3 +-- datastore/integration_test.go | 3 +-- datastore/key.go | 3 +-- datastore/oc_test.go | 3 +-- datastore/query.go | 3 +-- datastore/query_test.go | 3 +-- datastore/transaction.go | 3 +-- datastore/transaction_test.go | 3 +-- errorreporting/errors.go | 3 +-- errorreporting/errors_test.go | 3 +-- errorreporting/example_test.go | 3 +-- examples_test.go | 3 +-- firestore/client.go | 3 +-- firestore/client_test.go | 3 +-- firestore/collref.go | 3 +-- firestore/collref_test.go | 3 +-- firestore/conformance_test.go | 3 +-- firestore/docref.go | 3 +-- firestore/docref_test.go | 3 +-- firestore/examples_test.go | 3 +-- firestore/integration_test.go | 3 +-- firestore/internal/doc-snippets.go | 3 +-- firestore/mock_test.go | 3 +-- firestore/query.go | 3 +-- firestore/query_test.go | 3 +-- firestore/transaction.go | 3 +-- firestore/transaction_test.go | 3 +-- firestore/util_test.go | 3 +-- firestore/watch.go | 3 +-- firestore/watch_test.go | 3 +-- firestore/writebatch.go | 3 +-- firestore/writebatch_test.go | 3 +-- functions/metadata/metadata.go | 3 +-- functions/metadata/metadata_test.go | 3 +-- httpreplay/cmd/httpr/integration_test.go | 3 +-- httpreplay/httpreplay.go | 3 +-- httpreplay/httpreplay_not18.go | 3 +-- httpreplay/httpreplay_test.go | 3 +-- iam/iam.go | 3 +-- internal/retry.go | 3 +-- internal/retry_test.go | 3 +-- internal/testutil/context.go | 3 +-- logging/apiv2/WriteLogEntries_smoke_test.go | 3 +-- logging/examples_test.go | 3 +-- logging/internal/testing/fake.go | 3 +-- logging/logadmin/example_entry_iterator_test.go | 3 +-- logging/logadmin/example_metric_iterator_test.go | 3 +-- logging/logadmin/example_paging_test.go | 3 +-- logging/logadmin/example_resource_iterator_test.go | 3 +-- logging/logadmin/example_sink_iterator_test.go | 3 +-- logging/logadmin/examples_test.go | 3 +-- logging/logadmin/logadmin.go | 3 +-- logging/logadmin/logadmin_test.go | 3 +-- logging/logadmin/metrics.go | 3 +-- logging/logadmin/metrics_test.go | 3 +-- logging/logadmin/resources_test.go | 3 +-- logging/logadmin/sinks.go | 3 +-- logging/logadmin/sinks_test.go | 3 +-- logging/logging.go | 3 +-- logging/logging_test.go | 3 +-- longrunning/example_test.go | 3 +-- longrunning/longrunning.go | 3 +-- longrunning/longrunning_test.go | 3 +-- profiler/heap.go | 3 +-- profiler/integration_test.go | 3 +-- profiler/mocks/mock_profiler_client.go | 3 +-- profiler/profiler.go | 3 +-- profiler/profiler_test.go | 3 +-- profiler/proftest/proftest.go | 3 +-- pubsub/apiv1/pubsub_pull_example_test.go | 3 +-- pubsub/endtoend_test.go | 3 +-- pubsub/example_subscription_iterator_test.go | 3 +-- pubsub/example_test.go | 3 +-- pubsub/example_topic_iterator_test.go | 3 +-- pubsub/flow_controller.go | 3 +-- pubsub/flow_controller_test.go | 3 +-- pubsub/go18.go | 3 +-- pubsub/integration_test.go | 3 +-- pubsub/iterator.go | 3 +-- pubsub/iterator_test.go | 3 +-- pubsub/loadtest/benchmark_test.go | 3 +-- pubsub/loadtest/loadtest.go | 3 +-- pubsub/mock_test.go | 3 +-- pubsub/pstest/fake.go | 3 +-- pubsub/pstest/fake_test.go | 3 +-- pubsub/pstest_test.go | 3 +-- pubsub/pubsub.go | 3 +-- pubsub/pullstream.go | 3 +-- pubsub/pullstream_test.go | 3 +-- pubsub/snapshot.go | 3 +-- pubsub/streaming_pull_test.go | 3 +-- pubsub/subscription.go | 3 +-- pubsub/subscription_test.go | 3 +-- pubsub/timeout_test.go | 3 +-- pubsub/topic.go | 3 +-- pubsub/topic_test.go | 3 +-- rpcreplay/fake_test.go | 3 +-- rpcreplay/rpcreplay.go | 3 +-- rpcreplay/rpcreplay_test.go | 3 +-- spanner/batch.go | 3 +-- spanner/big_pdml_test.go | 3 +-- spanner/client.go | 3 +-- spanner/errors.go | 3 +-- spanner/errors_test.go | 3 +-- spanner/examples_test.go | 3 +-- spanner/go17_test.go | 3 +-- spanner/go18.go | 3 +-- spanner/integration_test.go | 3 +-- spanner/internal/testutil/mockclient.go | 3 +-- spanner/internal/testutil/mockserver.go | 3 +-- spanner/oc_test.go | 3 +-- spanner/pdml.go | 3 +-- spanner/pdml_test.go | 3 +-- spanner/read.go | 3 +-- spanner/read_test.go | 3 +-- spanner/retry.go | 3 +-- spanner/retry_test.go | 3 +-- spanner/session.go | 3 +-- spanner/session_test.go | 3 +-- spanner/transaction.go | 3 +-- spanner/transaction_test.go | 3 +-- storage/acl.go | 3 +-- storage/acl_test.go | 3 +-- storage/bucket.go | 3 +-- storage/copy.go | 3 +-- storage/copy_test.go | 3 +-- storage/example_test.go | 3 +-- storage/integration_test.go | 3 +-- storage/invoke_test.go | 3 +-- storage/mock_test.go | 3 +-- storage/notifications.go | 3 +-- storage/notifications_test.go | 3 +-- storage/oc_test.go | 3 +-- storage/reader.go | 3 +-- storage/reader_test.go | 3 +-- storage/storage.go | 3 +-- storage/storage_test.go | 3 +-- storage/writer.go | 3 +-- storage/writer_test.go | 3 +-- trace/grpc.go | 3 +-- trace/grpc_test.go | 3 +-- trace/trace.go | 3 +-- trace/trace_test.go | 3 +-- translate/examples_test.go | 3 +-- translate/internal/translate/v2/translate-nov2016-gen.go | 3 +-- translate/translate.go | 3 +-- translate/translate_test.go | 3 +-- vision/apiv1/client_test.go | 3 +-- vision/apiv1/examples_test.go | 3 +-- 190 files changed, 190 insertions(+), 380 deletions(-) diff --git a/bigquery/benchmarks/bench.go b/bigquery/benchmarks/bench.go index ffa43c33901a..7d608c8817a0 100644 --- a/bigquery/benchmarks/bench.go +++ b/bigquery/benchmarks/bench.go @@ -17,14 +17,13 @@ package main import ( + "context" "encoding/json" "flag" "io/ioutil" "log" "time" - "context" - "cloud.google.com/go/bigquery" "google.golang.org/api/iterator" ) diff --git a/bigquery/bigquery.go b/bigquery/bigquery.go index bed6fe39a376..83e160e39a57 100644 --- a/bigquery/bigquery.go +++ b/bigquery/bigquery.go @@ -15,13 +15,12 @@ package bigquery import ( + "context" "fmt" "io" "net/http" "time" - "context" - "cloud.google.com/go/internal" "cloud.google.com/go/internal/version" gax "github.com/googleapis/gax-go" diff --git a/bigquery/dataset.go b/bigquery/dataset.go index 488e2c861598..7bdb70a59eb4 100644 --- a/bigquery/dataset.go +++ b/bigquery/dataset.go @@ -15,12 +15,11 @@ package bigquery import ( + "context" "errors" "fmt" "time" - "context" - "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" bq "google.golang.org/api/bigquery/v2" diff --git a/bigquery/dataset_test.go b/bigquery/dataset_test.go index e10b7f295d71..03a0509711af 100644 --- a/bigquery/dataset_test.go +++ b/bigquery/dataset_test.go @@ -15,13 +15,12 @@ package bigquery import ( + "context" "errors" "strconv" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/google/go-cmp/cmp" bq "google.golang.org/api/bigquery/v2" diff --git a/bigquery/examples_test.go b/bigquery/examples_test.go index 3d7c8d405110..4c5681386367 100644 --- a/bigquery/examples_test.go +++ b/bigquery/examples_test.go @@ -15,12 +15,11 @@ package bigquery_test import ( + "context" "fmt" "os" "time" - "context" - "cloud.google.com/go/bigquery" "google.golang.org/api/iterator" ) diff --git a/bigquery/inserter.go b/bigquery/inserter.go index c15091c7de2f..132994e9bcc2 100644 --- a/bigquery/inserter.go +++ b/bigquery/inserter.go @@ -15,12 +15,11 @@ package bigquery import ( + "context" "errors" "fmt" "reflect" - "context" - "cloud.google.com/go/internal/trace" bq "google.golang.org/api/bigquery/v2" ) diff --git a/bigquery/integration_test.go b/bigquery/integration_test.go index 71f8bb9f5199..84ce2881ff44 100644 --- a/bigquery/integration_test.go +++ b/bigquery/integration_test.go @@ -15,6 +15,7 @@ package bigquery import ( + "context" "encoding/json" "errors" "flag" @@ -28,8 +29,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/civil" "cloud.google.com/go/httpreplay" "cloud.google.com/go/internal" diff --git a/bigquery/iterator.go b/bigquery/iterator.go index 9bbe1717a4a8..298143cbb48c 100644 --- a/bigquery/iterator.go +++ b/bigquery/iterator.go @@ -15,11 +15,10 @@ package bigquery import ( + "context" "fmt" "reflect" - "context" - bq "google.golang.org/api/bigquery/v2" "google.golang.org/api/iterator" ) diff --git a/bigquery/iterator_test.go b/bigquery/iterator_test.go index 2326fe8ce0f2..125796d7ccef 100644 --- a/bigquery/iterator_test.go +++ b/bigquery/iterator_test.go @@ -15,12 +15,11 @@ package bigquery import ( + "context" "errors" "fmt" "testing" - "context" - "cloud.google.com/go/internal/testutil" "google.golang.org/api/iterator" ) diff --git a/bigquery/job.go b/bigquery/job.go index c011f55c3269..d98211d91421 100644 --- a/bigquery/job.go +++ b/bigquery/job.go @@ -15,12 +15,11 @@ package bigquery import ( + "context" "errors" "fmt" "time" - "context" - "cloud.google.com/go/internal" "cloud.google.com/go/internal/trace" gax "github.com/googleapis/gax-go" diff --git a/bigquery/load.go b/bigquery/load.go index 8e56de23cc6a..1cbcc84ae608 100644 --- a/bigquery/load.go +++ b/bigquery/load.go @@ -15,9 +15,8 @@ package bigquery import ( - "io" - "context" + "io" "cloud.google.com/go/internal/trace" bq "google.golang.org/api/bigquery/v2" diff --git a/bigquery/oc_test.go b/bigquery/oc_test.go index 4f01e5f2c69a..07d1b7191979 100644 --- a/bigquery/oc_test.go +++ b/bigquery/oc_test.go @@ -17,9 +17,8 @@ package bigquery import ( - "testing" - "context" + "testing" "cloud.google.com/go/internal/testutil" ) diff --git a/bigquery/params_test.go b/bigquery/params_test.go index 8ab39d8120ae..6464e7966b00 100644 --- a/bigquery/params_test.go +++ b/bigquery/params_test.go @@ -15,6 +15,7 @@ package bigquery import ( + "context" "errors" "math" "math/big" @@ -22,8 +23,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/civil" "cloud.google.com/go/internal/testutil" "github.com/google/go-cmp/cmp" diff --git a/bigquery/query.go b/bigquery/query.go index e3850c58dd3a..735a54c453d4 100644 --- a/bigquery/query.go +++ b/bigquery/query.go @@ -15,9 +15,8 @@ package bigquery import ( - "errors" - "context" + "errors" "cloud.google.com/go/internal/trace" bq "google.golang.org/api/bigquery/v2" diff --git a/bigquery/read_test.go b/bigquery/read_test.go index 3c8a1a00a38e..883430a00c0e 100644 --- a/bigquery/read_test.go +++ b/bigquery/read_test.go @@ -15,11 +15,10 @@ package bigquery import ( + "context" "errors" "testing" - "context" - "cloud.google.com/go/internal/testutil" "github.com/google/go-cmp/cmp" bq "google.golang.org/api/bigquery/v2" diff --git a/bigquery/table.go b/bigquery/table.go index 3d2c4ed35ac9..6181f460b6a7 100644 --- a/bigquery/table.go +++ b/bigquery/table.go @@ -15,12 +15,11 @@ package bigquery import ( + "context" "errors" "fmt" "time" - "context" - "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" bq "google.golang.org/api/bigquery/v2" diff --git a/bigtable/admin.go b/bigtable/admin.go index 3f1d99935d62..5a0c23480cda 100644 --- a/bigtable/admin.go +++ b/bigtable/admin.go @@ -17,6 +17,7 @@ limitations under the License. package bigtable import ( + "context" "errors" "fmt" "math" @@ -24,8 +25,6 @@ import ( "strings" "time" - "context" - "cloud.google.com/go/bigtable/internal/gax" btopt "cloud.google.com/go/bigtable/internal/option" "cloud.google.com/go/iam" diff --git a/bigtable/admin_test.go b/bigtable/admin_test.go index 32b377422d3f..907f483ed526 100644 --- a/bigtable/admin_test.go +++ b/bigtable/admin_test.go @@ -15,6 +15,7 @@ package bigtable import ( + "context" "fmt" "math" "sort" @@ -22,8 +23,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/proto" "google.golang.org/api/iterator" diff --git a/bigtable/bigtable.go b/bigtable/bigtable.go index 0826c8a54e54..07b4ee885c79 100644 --- a/bigtable/bigtable.go +++ b/bigtable/bigtable.go @@ -17,14 +17,13 @@ limitations under the License. package bigtable // import "cloud.google.com/go/bigtable" import ( + "context" "errors" "fmt" "io" "strconv" "time" - "context" - "cloud.google.com/go/bigtable/internal/gax" btopt "cloud.google.com/go/bigtable/internal/option" "github.com/golang/protobuf/proto" diff --git a/bigtable/bigtable_test.go b/bigtable/bigtable_test.go index 568ff9279e80..55bf17aaa872 100644 --- a/bigtable/bigtable_test.go +++ b/bigtable/bigtable_test.go @@ -17,6 +17,7 @@ limitations under the License. package bigtable import ( + "context" "fmt" "math/rand" "strings" @@ -24,8 +25,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/google/go-cmp/cmp" "google.golang.org/api/option" diff --git a/bigtable/bttest/example_test.go b/bigtable/bttest/example_test.go index 9058d628b98f..6348c7c485eb 100644 --- a/bigtable/bttest/example_test.go +++ b/bigtable/bttest/example_test.go @@ -16,11 +16,10 @@ limitations under the License. package bttest_test import ( + "context" "fmt" "log" - "context" - "cloud.google.com/go/bigtable" "cloud.google.com/go/bigtable/bttest" "google.golang.org/api/option" diff --git a/bigtable/bttest/inmem.go b/bigtable/bttest/inmem.go index 1ace98cc3035..81bcf4efd876 100644 --- a/bigtable/bttest/inmem.go +++ b/bigtable/bttest/inmem.go @@ -31,6 +31,7 @@ package bttest // import "cloud.google.com/go/bigtable/bttest" import ( "bytes" + "context" "encoding/binary" "fmt" "log" @@ -42,8 +43,6 @@ import ( "sync" "time" - "context" - emptypb "github.com/golang/protobuf/ptypes/empty" "github.com/golang/protobuf/ptypes/wrappers" "github.com/google/btree" diff --git a/bigtable/bttest/inmem_test.go b/bigtable/bttest/inmem_test.go index ce647c43408b..df36c3ca6d43 100644 --- a/bigtable/bttest/inmem_test.go +++ b/bigtable/bttest/inmem_test.go @@ -15,6 +15,7 @@ package bttest import ( + "context" "fmt" "math/rand" "strconv" @@ -23,8 +24,6 @@ import ( "testing" "time" - "context" - "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" diff --git a/bigtable/cmd/cbt/cbt.go b/bigtable/cmd/cbt/cbt.go index e0e8d80c9d4f..b6986d4de20f 100644 --- a/bigtable/cmd/cbt/cbt.go +++ b/bigtable/cmd/cbt/cbt.go @@ -20,6 +20,7 @@ package main import ( "bytes" + "context" "encoding/csv" "flag" "fmt" @@ -35,8 +36,6 @@ import ( "text/template" "time" - "context" - "cloud.google.com/go/bigtable" "cloud.google.com/go/bigtable/internal/cbtconfig" "google.golang.org/api/iterator" diff --git a/bigtable/cmd/loadtest/loadtest.go b/bigtable/cmd/loadtest/loadtest.go index 5c04dd13dbd2..d05aac13239b 100644 --- a/bigtable/cmd/loadtest/loadtest.go +++ b/bigtable/cmd/loadtest/loadtest.go @@ -21,6 +21,7 @@ package main import ( "bytes" + "context" "flag" "fmt" "log" @@ -31,8 +32,6 @@ import ( "sync/atomic" "time" - "context" - "cloud.google.com/go/bigtable" "cloud.google.com/go/bigtable/internal/cbtconfig" "cloud.google.com/go/bigtable/internal/stat" diff --git a/bigtable/cmd/scantest/scantest.go b/bigtable/cmd/scantest/scantest.go index da18b36cc1a0..bcfde8cc6b1d 100644 --- a/bigtable/cmd/scantest/scantest.go +++ b/bigtable/cmd/scantest/scantest.go @@ -22,6 +22,7 @@ package main import ( "bytes" + "context" "flag" "fmt" "log" @@ -32,8 +33,6 @@ import ( "text/tabwriter" "time" - "context" - "cloud.google.com/go/bigtable" "cloud.google.com/go/bigtable/internal/cbtconfig" "cloud.google.com/go/bigtable/internal/stat" diff --git a/bigtable/export_test.go b/bigtable/export_test.go index d2cd19234f4d..33f55deabfc3 100644 --- a/bigtable/export_test.go +++ b/bigtable/export_test.go @@ -17,14 +17,13 @@ limitations under the License. package bigtable import ( + "context" "errors" "flag" "fmt" "strings" "time" - "context" - "cloud.google.com/go/bigtable/bttest" "google.golang.org/api/option" "google.golang.org/grpc" diff --git a/bigtable/go18.go b/bigtable/go18.go index 2389c9ce232c..13f8f664e5dd 100644 --- a/bigtable/go18.go +++ b/bigtable/go18.go @@ -17,9 +17,8 @@ package bigtable import ( - "fmt" - "context" + "fmt" "go.opencensus.io/plugin/ocgrpc" "go.opencensus.io/trace" diff --git a/bigtable/internal/gax/invoke.go b/bigtable/internal/gax/invoke.go index 453e0e9c73a2..228dd4438047 100644 --- a/bigtable/internal/gax/invoke.go +++ b/bigtable/internal/gax/invoke.go @@ -18,13 +18,12 @@ limitations under the License. package gax import ( + "context" "log" "math/rand" "os" "time" - "context" - "google.golang.org/grpc" "google.golang.org/grpc/codes" ) diff --git a/bigtable/internal/gax/invoke_test.go b/bigtable/internal/gax/invoke_test.go index a1d7f546ee6b..633ba687833e 100644 --- a/bigtable/internal/gax/invoke_test.go +++ b/bigtable/internal/gax/invoke_test.go @@ -16,11 +16,10 @@ limitations under the License. package gax import ( + "context" "testing" "time" - "context" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/bigtable/retry_test.go b/bigtable/retry_test.go index 8fb2df51cb65..9ffb6f961130 100644 --- a/bigtable/retry_test.go +++ b/bigtable/retry_test.go @@ -16,12 +16,11 @@ limitations under the License. package bigtable import ( + "context" "strings" "testing" "time" - "context" - "cloud.google.com/go/bigtable/bttest" "cloud.google.com/go/bigtable/internal/gax" "cloud.google.com/go/internal/testutil" diff --git a/cmd/go-cloud-debug-agent/debuglet.go b/cmd/go-cloud-debug-agent/debuglet.go index e55e3fa62f6c..b5852b6f6511 100644 --- a/cmd/go-cloud-debug-agent/debuglet.go +++ b/cmd/go-cloud-debug-agent/debuglet.go @@ -17,6 +17,7 @@ package main import ( + "context" "encoding/json" "flag" "fmt" @@ -27,8 +28,6 @@ import ( "sync" "time" - "context" - "cloud.google.com/go/cmd/go-cloud-debug-agent/internal/breakpoints" debuglet "cloud.google.com/go/cmd/go-cloud-debug-agent/internal/controller" "cloud.google.com/go/cmd/go-cloud-debug-agent/internal/debug" diff --git a/cmd/go-cloud-debug-agent/internal/controller/client.go b/cmd/go-cloud-debug-agent/internal/controller/client.go index c8c9bfc6f271..da5caaf2d93e 100644 --- a/cmd/go-cloud-debug-agent/internal/controller/client.go +++ b/cmd/go-cloud-debug-agent/internal/controller/client.go @@ -16,6 +16,7 @@ package controller import ( + "context" "crypto/sha256" "encoding/json" "errors" @@ -23,8 +24,6 @@ import ( "log" "sync" - "context" - "golang.org/x/oauth2" cd "google.golang.org/api/clouddebugger/v2" "google.golang.org/api/googleapi" diff --git a/cmd/go-cloud-debug-agent/internal/controller/client_test.go b/cmd/go-cloud-debug-agent/internal/controller/client_test.go index 5a861a6615c8..a5a9e32278c2 100644 --- a/cmd/go-cloud-debug-agent/internal/controller/client_test.go +++ b/cmd/go-cloud-debug-agent/internal/controller/client_test.go @@ -16,13 +16,12 @@ package controller import ( "bytes" + "context" "errors" "fmt" "strconv" "testing" - "context" - "golang.org/x/oauth2" cd "google.golang.org/api/clouddebugger/v2" "google.golang.org/api/googleapi" diff --git a/container/apiv1/ListClusters_smoke_test.go b/container/apiv1/ListClusters_smoke_test.go index 89b012431ddf..7d55b2f5d5ab 100644 --- a/container/apiv1/ListClusters_smoke_test.go +++ b/container/apiv1/ListClusters_smoke_test.go @@ -21,13 +21,12 @@ import ( ) import ( + "context" "fmt" "strconv" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "google.golang.org/api/iterator" "google.golang.org/api/option" diff --git a/container/apiv1/cluster_manager_client.go b/container/apiv1/cluster_manager_client.go index 01edd999f0f2..bb3011c37d87 100644 --- a/container/apiv1/cluster_manager_client.go +++ b/container/apiv1/cluster_manager_client.go @@ -17,9 +17,8 @@ package container import ( - "time" - "context" + "time" "cloud.google.com/go/internal/version" gax "github.com/googleapis/gax-go" diff --git a/container/apiv1/mock_test.go b/container/apiv1/mock_test.go index 01897d94d18c..f90aa7a4b315 100644 --- a/container/apiv1/mock_test.go +++ b/container/apiv1/mock_test.go @@ -22,6 +22,7 @@ import ( ) import ( + "context" "flag" "fmt" "io" @@ -31,8 +32,6 @@ import ( "strings" "testing" - "context" - "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" "google.golang.org/api/option" diff --git a/container/container.go b/container/container.go index 47b2e2bca233..aac46d823b29 100644 --- a/container/container.go +++ b/container/container.go @@ -18,12 +18,11 @@ package container // import "cloud.google.com/go/container" import ( + "context" "errors" "fmt" "time" - "context" - raw "google.golang.org/api/container/v1" "google.golang.org/api/option" htransport "google.golang.org/api/transport/http" diff --git a/datastore/client.go b/datastore/client.go index 557148304758..8eee203be76f 100644 --- a/datastore/client.go +++ b/datastore/client.go @@ -15,9 +15,8 @@ package datastore import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/internal" "cloud.google.com/go/internal/version" diff --git a/datastore/datastore.go b/datastore/datastore.go index a45d7ed61355..60be3cd028f1 100644 --- a/datastore/datastore.go +++ b/datastore/datastore.go @@ -15,14 +15,13 @@ package datastore import ( + "context" "errors" "fmt" "log" "os" "reflect" - "context" - "cloud.google.com/go/internal/trace" "google.golang.org/api/option" gtransport "google.golang.org/api/transport/grpc" diff --git a/datastore/datastore_test.go b/datastore/datastore_test.go index e78d1891815c..bc805d8fb3e5 100644 --- a/datastore/datastore_test.go +++ b/datastore/datastore_test.go @@ -15,6 +15,7 @@ package datastore import ( + "context" "encoding/json" "errors" "fmt" @@ -24,8 +25,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" diff --git a/datastore/example_test.go b/datastore/example_test.go index ab4ada8a22b1..e611579cce37 100644 --- a/datastore/example_test.go +++ b/datastore/example_test.go @@ -15,12 +15,11 @@ package datastore_test import ( + "context" "fmt" "log" "time" - "context" - "cloud.google.com/go/datastore" "google.golang.org/api/iterator" ) diff --git a/datastore/integration_test.go b/datastore/integration_test.go index 227887340e1f..bb8e6d55a99d 100644 --- a/datastore/integration_test.go +++ b/datastore/integration_test.go @@ -15,6 +15,7 @@ package datastore import ( + "context" "encoding/json" "errors" "flag" @@ -29,8 +30,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/rpcreplay" "google.golang.org/api/iterator" diff --git a/datastore/key.go b/datastore/key.go index a6cc535e38b6..778fa26056da 100644 --- a/datastore/key.go +++ b/datastore/key.go @@ -16,14 +16,13 @@ package datastore import ( "bytes" + "context" "encoding/base64" "encoding/gob" "errors" "strconv" "strings" - "context" - "github.com/golang/protobuf/proto" pb "google.golang.org/genproto/googleapis/datastore/v1" ) diff --git a/datastore/oc_test.go b/datastore/oc_test.go index df6049c0d9bc..836c2719bf24 100644 --- a/datastore/oc_test.go +++ b/datastore/oc_test.go @@ -17,9 +17,8 @@ package datastore import ( - "testing" - "context" + "testing" "cloud.google.com/go/internal/testutil" ) diff --git a/datastore/query.go b/datastore/query.go index 34aced1d2ab9..19576cddc1b3 100644 --- a/datastore/query.go +++ b/datastore/query.go @@ -15,6 +15,7 @@ package datastore import ( + "context" "encoding/base64" "errors" "fmt" @@ -23,8 +24,6 @@ import ( "strconv" "strings" - "context" - "cloud.google.com/go/internal/trace" wrapperspb "github.com/golang/protobuf/ptypes/wrappers" "google.golang.org/api/iterator" diff --git a/datastore/query_test.go b/datastore/query_test.go index 14ff5f85627a..180606524224 100644 --- a/datastore/query_test.go +++ b/datastore/query_test.go @@ -15,14 +15,13 @@ package datastore import ( + "context" "errors" "fmt" "reflect" "sort" "testing" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/proto" "github.com/google/go-cmp/cmp" diff --git a/datastore/transaction.go b/datastore/transaction.go index cbf9c54e860e..236f505da71e 100644 --- a/datastore/transaction.go +++ b/datastore/transaction.go @@ -15,9 +15,8 @@ package datastore import ( - "errors" - "context" + "errors" "cloud.google.com/go/internal/trace" pb "google.golang.org/genproto/googleapis/datastore/v1" diff --git a/datastore/transaction_test.go b/datastore/transaction_test.go index a648407f9284..31d7e9fcbac4 100644 --- a/datastore/transaction_test.go +++ b/datastore/transaction_test.go @@ -15,9 +15,8 @@ package datastore import ( - "testing" - "context" + "testing" "github.com/golang/protobuf/proto" pb "google.golang.org/genproto/googleapis/datastore/v1" diff --git a/errorreporting/errors.go b/errorreporting/errors.go index 48d259a2a115..1a47057971c6 100644 --- a/errorreporting/errors.go +++ b/errorreporting/errors.go @@ -21,14 +21,13 @@ package errorreporting // import "cloud.google.com/go/errorreporting" import ( "bytes" + "context" "fmt" "log" "net/http" "runtime" "time" - "context" - vkit "cloud.google.com/go/errorreporting/apiv1beta1" "cloud.google.com/go/internal/version" "github.com/golang/protobuf/ptypes" diff --git a/errorreporting/errors_test.go b/errorreporting/errors_test.go index 26b4222bf5fd..29a7adb84445 100644 --- a/errorreporting/errors_test.go +++ b/errorreporting/errors_test.go @@ -15,13 +15,12 @@ package errorreporting import ( + "context" "errors" "strings" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" gax "github.com/googleapis/gax-go" "google.golang.org/api/option" diff --git a/errorreporting/example_test.go b/errorreporting/example_test.go index 9a4f0c53287c..f06c36b8d07c 100644 --- a/errorreporting/example_test.go +++ b/errorreporting/example_test.go @@ -15,11 +15,10 @@ package errorreporting_test import ( + "context" "errors" "log" - "context" - "cloud.google.com/go/errorreporting" ) diff --git a/examples_test.go b/examples_test.go index 34c5e3b60472..c623ba9dfd22 100644 --- a/examples_test.go +++ b/examples_test.go @@ -15,9 +15,8 @@ package cloud_test import ( - "time" - "context" + "time" "cloud.google.com/go/bigquery" ) diff --git a/firestore/client.go b/firestore/client.go index 52fc7604658b..a5f014f71440 100644 --- a/firestore/client.go +++ b/firestore/client.go @@ -15,14 +15,13 @@ package firestore import ( + "context" "errors" "fmt" "io" "strings" "time" - "context" - vkit "cloud.google.com/go/firestore/apiv1beta1" "cloud.google.com/go/internal/version" "github.com/golang/protobuf/ptypes" diff --git a/firestore/client_test.go b/firestore/client_test.go index 5dd96b418b04..92ff877ec780 100644 --- a/firestore/client_test.go +++ b/firestore/client_test.go @@ -15,9 +15,8 @@ package firestore import ( - "testing" - "context" + "testing" tspb "github.com/golang/protobuf/ptypes/timestamp" pb "google.golang.org/genproto/googleapis/firestore/v1beta1" diff --git a/firestore/collref.go b/firestore/collref.go index 2f1fd045d850..ff445d118562 100644 --- a/firestore/collref.go +++ b/firestore/collref.go @@ -15,12 +15,11 @@ package firestore import ( + "context" "math/rand" "os" "sync" "time" - - "context" ) // A CollectionRef is a reference to Firestore collection. diff --git a/firestore/collref_test.go b/firestore/collref_test.go index 65ac51911b53..e77c0db666a1 100644 --- a/firestore/collref_test.go +++ b/firestore/collref_test.go @@ -15,9 +15,8 @@ package firestore import ( - "testing" - "context" + "testing" "github.com/golang/protobuf/proto" pb "google.golang.org/genproto/googleapis/firestore/v1beta1" diff --git a/firestore/conformance_test.go b/firestore/conformance_test.go index 28a2aa65af67..1fcbaaa7af8f 100644 --- a/firestore/conformance_test.go +++ b/firestore/conformance_test.go @@ -17,6 +17,7 @@ package firestore import ( + "context" "encoding/json" "errors" "fmt" @@ -28,8 +29,6 @@ import ( "testing" "time" - "context" - pb "cloud.google.com/go/firestore/genproto" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/firestore/docref.go b/firestore/docref.go index b6a80dd2e62e..422b6bdeae81 100644 --- a/firestore/docref.go +++ b/firestore/docref.go @@ -15,14 +15,13 @@ package firestore import ( + "context" "errors" "fmt" "io" "reflect" "sort" - "context" - vkit "cloud.google.com/go/firestore/apiv1beta1" "google.golang.org/api/iterator" pb "google.golang.org/genproto/googleapis/firestore/v1beta1" diff --git a/firestore/docref_test.go b/firestore/docref_test.go index 2d7a6af7ccf5..cda97a00c3f6 100644 --- a/firestore/docref_test.go +++ b/firestore/docref_test.go @@ -15,13 +15,12 @@ package firestore import ( + "context" "reflect" "sort" "testing" "time" - "context" - pb "google.golang.org/genproto/googleapis/firestore/v1beta1" "google.golang.org/genproto/googleapis/type/latlng" "google.golang.org/grpc" diff --git a/firestore/examples_test.go b/firestore/examples_test.go index bb05a39ea2e9..40e5d989ea73 100644 --- a/firestore/examples_test.go +++ b/firestore/examples_test.go @@ -17,9 +17,8 @@ package firestore_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/firestore" "google.golang.org/api/iterator" diff --git a/firestore/integration_test.go b/firestore/integration_test.go index 5e684c85ea93..bf9c9ffab7dc 100644 --- a/firestore/integration_test.go +++ b/firestore/integration_test.go @@ -15,6 +15,7 @@ package firestore import ( + "context" "errors" "flag" "fmt" @@ -27,8 +28,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/pretty" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" diff --git a/firestore/internal/doc-snippets.go b/firestore/internal/doc-snippets.go index daa573cffe70..44a1568745c1 100644 --- a/firestore/internal/doc-snippets.go +++ b/firestore/internal/doc-snippets.go @@ -17,9 +17,8 @@ package internal // TODO(deklerk) can this file and directory be deleted, or is it being used for documentation somewhere? import ( - "fmt" - "context" + "fmt" firestore "cloud.google.com/go/firestore" "google.golang.org/api/iterator" diff --git a/firestore/mock_test.go b/firestore/mock_test.go index cd8a35dc9151..a482a6c5555b 100644 --- a/firestore/mock_test.go +++ b/firestore/mock_test.go @@ -17,12 +17,11 @@ package firestore // A simple mock server. import ( + "context" "fmt" "sort" "strings" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/empty" diff --git a/firestore/query.go b/firestore/query.go index d7df333e6af7..71b0b3b596fa 100644 --- a/firestore/query.go +++ b/firestore/query.go @@ -15,6 +15,7 @@ package firestore import ( + "context" "errors" "fmt" "io" @@ -22,8 +23,6 @@ import ( "reflect" "time" - "context" - "cloud.google.com/go/internal/btree" "github.com/golang/protobuf/ptypes/wrappers" "google.golang.org/api/iterator" diff --git a/firestore/query_test.go b/firestore/query_test.go index b76705fa5dcc..4c25d95ea4e6 100644 --- a/firestore/query_test.go +++ b/firestore/query_test.go @@ -15,12 +15,11 @@ package firestore import ( + "context" "math" "sort" "testing" - "context" - "cloud.google.com/go/internal/pretty" tspb "github.com/golang/protobuf/ptypes/timestamp" "github.com/golang/protobuf/ptypes/wrappers" diff --git a/firestore/transaction.go b/firestore/transaction.go index 59ea785910ca..5bfe3e78db9c 100644 --- a/firestore/transaction.go +++ b/firestore/transaction.go @@ -15,9 +15,8 @@ package firestore import ( - "errors" - "context" + "errors" gax "github.com/googleapis/gax-go" pb "google.golang.org/genproto/googleapis/firestore/v1beta1" diff --git a/firestore/transaction_test.go b/firestore/transaction_test.go index baa11c84a454..3955a1a3174c 100644 --- a/firestore/transaction_test.go +++ b/firestore/transaction_test.go @@ -15,9 +15,8 @@ package firestore import ( - "testing" - "context" + "testing" "github.com/golang/protobuf/ptypes/empty" "google.golang.org/api/iterator" diff --git a/firestore/util_test.go b/firestore/util_test.go index 497ed6909ae9..b655d3723000 100644 --- a/firestore/util_test.go +++ b/firestore/util_test.go @@ -15,12 +15,11 @@ package firestore import ( + "context" "fmt" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/ptypes" tspb "github.com/golang/protobuf/ptypes/timestamp" diff --git a/firestore/watch.go b/firestore/watch.go index c9e1623b454d..ec31d9833ec9 100644 --- a/firestore/watch.go +++ b/firestore/watch.go @@ -15,6 +15,7 @@ package firestore import ( + "context" "errors" "fmt" "io" @@ -22,8 +23,6 @@ import ( "sort" "time" - "context" - "cloud.google.com/go/internal/btree" "github.com/golang/protobuf/ptypes" gax "github.com/googleapis/gax-go" diff --git a/firestore/watch_test.go b/firestore/watch_test.go index 57861c2a6143..c7f163f01388 100644 --- a/firestore/watch_test.go +++ b/firestore/watch_test.go @@ -15,12 +15,11 @@ package firestore import ( + "context" "sort" "testing" "time" - "context" - "cloud.google.com/go/internal/btree" "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go" diff --git a/firestore/writebatch.go b/firestore/writebatch.go index 2af5facc3607..5ed3429a77af 100644 --- a/firestore/writebatch.go +++ b/firestore/writebatch.go @@ -15,9 +15,8 @@ package firestore import ( - "errors" - "context" + "errors" pb "google.golang.org/genproto/googleapis/firestore/v1beta1" ) diff --git a/firestore/writebatch_test.go b/firestore/writebatch_test.go index d9b2b99d6674..fa688c04bafe 100644 --- a/firestore/writebatch_test.go +++ b/firestore/writebatch_test.go @@ -15,9 +15,8 @@ package firestore import ( - "testing" - "context" + "testing" pb "google.golang.org/genproto/googleapis/firestore/v1beta1" ) diff --git a/functions/metadata/metadata.go b/functions/metadata/metadata.go index 3d052ac88923..128d72288cdc 100644 --- a/functions/metadata/metadata.go +++ b/functions/metadata/metadata.go @@ -17,9 +17,8 @@ package metadata // import "cloud.google.com/go/functions/metadata" import ( - "time" - "context" + "time" ) type contextKey struct{} diff --git a/functions/metadata/metadata_test.go b/functions/metadata/metadata_test.go index 54dc3dc7f95f..561649b066e1 100644 --- a/functions/metadata/metadata_test.go +++ b/functions/metadata/metadata_test.go @@ -15,9 +15,8 @@ package metadata import ( - "testing" - "context" + "testing" ) func TestMetadata(t *testing.T) { diff --git a/httpreplay/cmd/httpr/integration_test.go b/httpreplay/cmd/httpr/integration_test.go index 7bcf8ba0d694..7d370b460e9b 100644 --- a/httpreplay/cmd/httpr/integration_test.go +++ b/httpreplay/cmd/httpr/integration_test.go @@ -17,6 +17,7 @@ package main_test import ( + "context" "crypto/tls" "crypto/x509" "errors" @@ -31,8 +32,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/storage" "golang.org/x/oauth2" diff --git a/httpreplay/httpreplay.go b/httpreplay/httpreplay.go index 4771e6210366..86de2c0d2ce8 100644 --- a/httpreplay/httpreplay.go +++ b/httpreplay/httpreplay.go @@ -36,9 +36,8 @@ package httpreplay // TODO(jba): add examples. import ( - "net/http" - "context" + "net/http" "cloud.google.com/go/httpreplay/internal/proxy" "google.golang.org/api/option" diff --git a/httpreplay/httpreplay_not18.go b/httpreplay/httpreplay_not18.go index bca74e8dbffb..3fbbf65fe1c9 100644 --- a/httpreplay/httpreplay_not18.go +++ b/httpreplay/httpreplay_not18.go @@ -19,9 +19,8 @@ package httpreplay import ( - "net/http" - "context" + "net/http" "google.golang.org/api/option" ) diff --git a/httpreplay/httpreplay_test.go b/httpreplay/httpreplay_test.go index abb0daaa167c..45f7fa59d84f 100644 --- a/httpreplay/httpreplay_test.go +++ b/httpreplay/httpreplay_test.go @@ -18,6 +18,7 @@ package httpreplay_test import ( "bytes" + "context" "encoding/json" "io/ioutil" "net/http" @@ -25,8 +26,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/httpreplay" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/storage" diff --git a/iam/iam.go b/iam/iam.go index a08e8c92202b..76df6356176e 100644 --- a/iam/iam.go +++ b/iam/iam.go @@ -22,9 +22,8 @@ package iam import ( - "time" - "context" + "time" gax "github.com/googleapis/gax-go" pb "google.golang.org/genproto/googleapis/iam/v1" diff --git a/internal/retry.go b/internal/retry.go index eb233da4162b..99093cc46510 100644 --- a/internal/retry.go +++ b/internal/retry.go @@ -15,9 +15,8 @@ package internal import ( - "time" - "context" + "time" gax "github.com/googleapis/gax-go" ) diff --git a/internal/retry_test.go b/internal/retry_test.go index c8464b2c2f81..367f52c91e7c 100644 --- a/internal/retry_test.go +++ b/internal/retry_test.go @@ -15,13 +15,12 @@ package internal import ( + "context" "errors" "fmt" "testing" "time" - "context" - gax "github.com/googleapis/gax-go" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/internal/testutil/context.go b/internal/testutil/context.go index 2073a0144c61..93797fa421f4 100644 --- a/internal/testutil/context.go +++ b/internal/testutil/context.go @@ -16,13 +16,12 @@ package testutil import ( + "context" "fmt" "io/ioutil" "log" "os" - "context" - "golang.org/x/oauth2" "golang.org/x/oauth2/google" "golang.org/x/oauth2/jwt" diff --git a/logging/apiv2/WriteLogEntries_smoke_test.go b/logging/apiv2/WriteLogEntries_smoke_test.go index 771d6c357d0f..ed8d1d022cf7 100644 --- a/logging/apiv2/WriteLogEntries_smoke_test.go +++ b/logging/apiv2/WriteLogEntries_smoke_test.go @@ -21,13 +21,12 @@ import ( ) import ( + "context" "fmt" "strconv" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "google.golang.org/api/iterator" "google.golang.org/api/option" diff --git a/logging/examples_test.go b/logging/examples_test.go index 2032bb252e23..44a8c82c1872 100644 --- a/logging/examples_test.go +++ b/logging/examples_test.go @@ -15,12 +15,11 @@ package logging_test import ( + "context" "encoding/json" "fmt" "os" - "context" - "cloud.google.com/go/logging" ) diff --git a/logging/internal/testing/fake.go b/logging/internal/testing/fake.go index a7cce7d0e259..ecec835d5444 100644 --- a/logging/internal/testing/fake.go +++ b/logging/internal/testing/fake.go @@ -18,6 +18,7 @@ limitations under the License. package testing import ( + "context" "errors" "fmt" "regexp" @@ -26,8 +27,6 @@ import ( "sync" "time" - "context" - "cloud.google.com/go/internal/testutil" emptypb "github.com/golang/protobuf/ptypes/empty" tspb "github.com/golang/protobuf/ptypes/timestamp" diff --git a/logging/logadmin/example_entry_iterator_test.go b/logging/logadmin/example_entry_iterator_test.go index 2fd13011c753..f0fe138e3750 100644 --- a/logging/logadmin/example_entry_iterator_test.go +++ b/logging/logadmin/example_entry_iterator_test.go @@ -15,11 +15,10 @@ package logadmin_test import ( + "context" "fmt" "time" - "context" - "cloud.google.com/go/logging/logadmin" "google.golang.org/api/iterator" ) diff --git a/logging/logadmin/example_metric_iterator_test.go b/logging/logadmin/example_metric_iterator_test.go index 3be12fae0784..91d1d00af3f2 100644 --- a/logging/logadmin/example_metric_iterator_test.go +++ b/logging/logadmin/example_metric_iterator_test.go @@ -15,9 +15,8 @@ package logadmin_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/logging/logadmin" "google.golang.org/api/iterator" diff --git a/logging/logadmin/example_paging_test.go b/logging/logadmin/example_paging_test.go index ef893f0df40e..4f71f492d753 100644 --- a/logging/logadmin/example_paging_test.go +++ b/logging/logadmin/example_paging_test.go @@ -16,14 +16,13 @@ package logadmin_test import ( "bytes" + "context" "flag" "fmt" "html/template" "log" "net/http" - "context" - "cloud.google.com/go/logging" "cloud.google.com/go/logging/logadmin" "google.golang.org/api/iterator" diff --git a/logging/logadmin/example_resource_iterator_test.go b/logging/logadmin/example_resource_iterator_test.go index 82cc8b995c7c..208f95f4f0e5 100644 --- a/logging/logadmin/example_resource_iterator_test.go +++ b/logging/logadmin/example_resource_iterator_test.go @@ -15,9 +15,8 @@ package logadmin_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/logging/logadmin" "google.golang.org/api/iterator" diff --git a/logging/logadmin/example_sink_iterator_test.go b/logging/logadmin/example_sink_iterator_test.go index eac085d925c8..0cf333dd6b3d 100644 --- a/logging/logadmin/example_sink_iterator_test.go +++ b/logging/logadmin/example_sink_iterator_test.go @@ -15,9 +15,8 @@ package logadmin_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/logging/logadmin" "google.golang.org/api/iterator" diff --git a/logging/logadmin/examples_test.go b/logging/logadmin/examples_test.go index 692020a346e7..e950fe457317 100644 --- a/logging/logadmin/examples_test.go +++ b/logging/logadmin/examples_test.go @@ -15,9 +15,8 @@ package logadmin_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/logging/logadmin" ) diff --git a/logging/logadmin/logadmin.go b/logging/logadmin/logadmin.go index cb594005494c..baccec17a7e7 100644 --- a/logging/logadmin/logadmin.go +++ b/logging/logadmin/logadmin.go @@ -26,6 +26,7 @@ package logadmin // import "cloud.google.com/go/logging/logadmin" import ( + "context" "fmt" "math" "net/http" @@ -33,8 +34,6 @@ import ( "strings" "time" - "context" - "cloud.google.com/go/internal/version" "cloud.google.com/go/logging" vkit "cloud.google.com/go/logging/apiv2" diff --git a/logging/logadmin/logadmin_test.go b/logging/logadmin/logadmin_test.go index a03173a3fde6..5b5c1b325108 100644 --- a/logging/logadmin/logadmin_test.go +++ b/logging/logadmin/logadmin_test.go @@ -17,6 +17,7 @@ package logadmin import ( + "context" "flag" "log" "net/http" @@ -25,8 +26,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/logging" ltesting "cloud.google.com/go/logging/internal/testing" diff --git a/logging/logadmin/metrics.go b/logging/logadmin/metrics.go index dad854f54620..2f673b64b637 100644 --- a/logging/logadmin/metrics.go +++ b/logging/logadmin/metrics.go @@ -15,9 +15,8 @@ package logadmin import ( - "fmt" - "context" + "fmt" vkit "cloud.google.com/go/logging/apiv2" "google.golang.org/api/iterator" diff --git a/logging/logadmin/metrics_test.go b/logging/logadmin/metrics_test.go index 92f2d4faf209..afcbe794ea08 100644 --- a/logging/logadmin/metrics_test.go +++ b/logging/logadmin/metrics_test.go @@ -15,12 +15,11 @@ package logadmin import ( + "context" "log" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" "google.golang.org/api/iterator" diff --git a/logging/logadmin/resources_test.go b/logging/logadmin/resources_test.go index fe457992f50b..a1f1e87e1363 100644 --- a/logging/logadmin/resources_test.go +++ b/logging/logadmin/resources_test.go @@ -15,9 +15,8 @@ package logadmin import ( - "testing" - "context" + "testing" "google.golang.org/api/iterator" ) diff --git a/logging/logadmin/sinks.go b/logging/logadmin/sinks.go index c4e022bb8e09..2b54fe8625fb 100644 --- a/logging/logadmin/sinks.go +++ b/logging/logadmin/sinks.go @@ -15,11 +15,10 @@ package logadmin import ( + "context" "errors" "fmt" - "context" - vkit "cloud.google.com/go/logging/apiv2" "google.golang.org/api/iterator" logpb "google.golang.org/genproto/googleapis/logging/v2" diff --git a/logging/logadmin/sinks_test.go b/logging/logadmin/sinks_test.go index 4bbbe72bb432..aa59d61a663c 100644 --- a/logging/logadmin/sinks_test.go +++ b/logging/logadmin/sinks_test.go @@ -19,12 +19,11 @@ package logadmin import ( + "context" "log" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" ltest "cloud.google.com/go/logging/internal/testing" diff --git a/logging/logging.go b/logging/logging.go index c349260ec54e..6cc3ebb5fa9c 100644 --- a/logging/logging.go +++ b/logging/logging.go @@ -25,6 +25,7 @@ package logging import ( + "context" "encoding/json" "errors" "fmt" @@ -35,8 +36,6 @@ import ( "sync" "time" - "context" - "cloud.google.com/go/compute/metadata" "cloud.google.com/go/internal/version" vkit "cloud.google.com/go/logging/apiv2" diff --git a/logging/logging_test.go b/logging/logging_test.go index 2a36488f5ef3..64c795beb95b 100644 --- a/logging/logging_test.go +++ b/logging/logging_test.go @@ -17,6 +17,7 @@ package logging_test import ( + "context" "flag" "fmt" "log" @@ -28,8 +29,6 @@ import ( "testing" "time" - "context" - cinternal "cloud.google.com/go/internal" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" diff --git a/longrunning/example_test.go b/longrunning/example_test.go index 9d510afec725..c88c2e8c352a 100644 --- a/longrunning/example_test.go +++ b/longrunning/example_test.go @@ -15,11 +15,10 @@ package longrunning import ( + "context" "fmt" "time" - "context" - "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" "github.com/golang/protobuf/ptypes/timestamp" diff --git a/longrunning/longrunning.go b/longrunning/longrunning.go index b363ae6092cd..270cd1cba642 100644 --- a/longrunning/longrunning.go +++ b/longrunning/longrunning.go @@ -22,12 +22,11 @@ package longrunning // import "cloud.google.com/go/longrunning" import ( + "context" "errors" "fmt" "time" - "context" - autogen "cloud.google.com/go/longrunning/autogen" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/longrunning/longrunning_test.go b/longrunning/longrunning_test.go index 5b1b04cefed6..7c07dd5c2746 100644 --- a/longrunning/longrunning_test.go +++ b/longrunning/longrunning_test.go @@ -18,12 +18,11 @@ package longrunning import ( + "context" "errors" "testing" "time" - "context" - "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" "github.com/golang/protobuf/ptypes/duration" diff --git a/profiler/heap.go b/profiler/heap.go index ee6a66bbabe2..704e72e1ee75 100644 --- a/profiler/heap.go +++ b/profiler/heap.go @@ -16,12 +16,11 @@ package profiler import ( "bytes" + "context" "fmt" "runtime" "time" - "context" - "github.com/google/pprof/profile" ) diff --git a/profiler/integration_test.go b/profiler/integration_test.go index b747668444b8..8f1ea35fbd55 100644 --- a/profiler/integration_test.go +++ b/profiler/integration_test.go @@ -18,6 +18,7 @@ package profiler import ( "bytes" + "context" "flag" "fmt" "os" @@ -27,8 +28,6 @@ import ( "text/template" "time" - "context" - "cloud.google.com/go/profiler/proftest" "golang.org/x/oauth2/google" compute "google.golang.org/api/compute/v1" diff --git a/profiler/mocks/mock_profiler_client.go b/profiler/mocks/mock_profiler_client.go index 00eef0ad1ff6..7a8ecf3efbdd 100644 --- a/profiler/mocks/mock_profiler_client.go +++ b/profiler/mocks/mock_profiler_client.go @@ -19,9 +19,8 @@ package mocks import ( - reflect "reflect" - "context" + reflect "reflect" gomock "github.com/golang/mock/gomock" v2 "google.golang.org/genproto/googleapis/devtools/cloudprofiler/v2" diff --git a/profiler/profiler.go b/profiler/profiler.go index 9e71016f1353..40116061099f 100644 --- a/profiler/profiler.go +++ b/profiler/profiler.go @@ -38,6 +38,7 @@ package profiler import ( "bytes" + "context" "errors" "fmt" "log" @@ -48,8 +49,6 @@ import ( "sync" "time" - "context" - gcemd "cloud.google.com/go/compute/metadata" "cloud.google.com/go/internal/version" "github.com/golang/protobuf/proto" diff --git a/profiler/profiler_test.go b/profiler/profiler_test.go index 95a8ab914e80..6fdad03cba0c 100644 --- a/profiler/profiler_test.go +++ b/profiler/profiler_test.go @@ -17,6 +17,7 @@ package profiler import ( "bytes" "compress/gzip" + "context" "errors" "fmt" "io" @@ -29,8 +30,6 @@ import ( "testing" "time" - "context" - gcemd "cloud.google.com/go/compute/metadata" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/profiler/mocks" diff --git a/profiler/proftest/proftest.go b/profiler/proftest/proftest.go index 5fe9664020ed..561414ce8d37 100644 --- a/profiler/proftest/proftest.go +++ b/profiler/proftest/proftest.go @@ -25,6 +25,7 @@ package proftest import ( "archive/zip" "bytes" + "context" "encoding/json" "errors" "fmt" @@ -34,8 +35,6 @@ import ( "strings" "time" - "context" - "cloud.google.com/go/storage" gax "github.com/googleapis/gax-go" "golang.org/x/build/kubernetes" diff --git a/pubsub/apiv1/pubsub_pull_example_test.go b/pubsub/apiv1/pubsub_pull_example_test.go index 8cbfd757572b..21fe7619aaef 100644 --- a/pubsub/apiv1/pubsub_pull_example_test.go +++ b/pubsub/apiv1/pubsub_pull_example_test.go @@ -15,12 +15,11 @@ package pubsub_test import ( + "context" "fmt" "log" "time" - "context" - "cloud.google.com/go/pubsub/apiv1" pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" ) diff --git a/pubsub/endtoend_test.go b/pubsub/endtoend_test.go index f15eeedf7ddc..d522f368b80c 100644 --- a/pubsub/endtoend_test.go +++ b/pubsub/endtoend_test.go @@ -16,6 +16,7 @@ package pubsub import ( "bytes" + "context" "fmt" "log" "math/rand" @@ -24,8 +25,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "google.golang.org/api/option" ) diff --git a/pubsub/example_subscription_iterator_test.go b/pubsub/example_subscription_iterator_test.go index e4c5825bcb9b..edf7a7ac1412 100644 --- a/pubsub/example_subscription_iterator_test.go +++ b/pubsub/example_subscription_iterator_test.go @@ -15,9 +15,8 @@ package pubsub_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/pubsub" "google.golang.org/api/iterator" diff --git a/pubsub/example_test.go b/pubsub/example_test.go index 3b12da51ae2a..f77c957f6fbb 100644 --- a/pubsub/example_test.go +++ b/pubsub/example_test.go @@ -15,11 +15,10 @@ package pubsub_test import ( + "context" "fmt" "time" - "context" - "cloud.google.com/go/pubsub" "google.golang.org/api/iterator" ) diff --git a/pubsub/example_topic_iterator_test.go b/pubsub/example_topic_iterator_test.go index 0fc2fc7940cb..e480d0e312fb 100644 --- a/pubsub/example_topic_iterator_test.go +++ b/pubsub/example_topic_iterator_test.go @@ -15,9 +15,8 @@ package pubsub_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/pubsub" "google.golang.org/api/iterator" diff --git a/pubsub/flow_controller.go b/pubsub/flow_controller.go index 145edc86508c..3f165a0ac18c 100644 --- a/pubsub/flow_controller.go +++ b/pubsub/flow_controller.go @@ -15,9 +15,8 @@ package pubsub import ( - "sync/atomic" - "context" + "sync/atomic" "golang.org/x/sync/semaphore" ) diff --git a/pubsub/flow_controller_test.go b/pubsub/flow_controller_test.go index c566f7ba76cd..71c41cbf165c 100644 --- a/pubsub/flow_controller_test.go +++ b/pubsub/flow_controller_test.go @@ -15,14 +15,13 @@ package pubsub import ( + "context" "errors" "fmt" "sync/atomic" "testing" "time" - "context" - "golang.org/x/sync/errgroup" ) diff --git a/pubsub/go18.go b/pubsub/go18.go index e742f0b067aa..9396cf11c87e 100644 --- a/pubsub/go18.go +++ b/pubsub/go18.go @@ -17,11 +17,10 @@ package pubsub import ( + "context" "log" "sync" - "context" - "go.opencensus.io/plugin/ocgrpc" "go.opencensus.io/stats" "go.opencensus.io/stats/view" diff --git a/pubsub/integration_test.go b/pubsub/integration_test.go index deba6bdf4ff6..5880c633fd6d 100644 --- a/pubsub/integration_test.go +++ b/pubsub/integration_test.go @@ -15,12 +15,11 @@ package pubsub import ( + "context" "fmt" "testing" "time" - "context" - "cloud.google.com/go/iam" "cloud.google.com/go/internal" "cloud.google.com/go/internal/testutil" diff --git a/pubsub/iterator.go b/pubsub/iterator.go index 25bfb758cf2e..5b3415e421c9 100644 --- a/pubsub/iterator.go +++ b/pubsub/iterator.go @@ -15,12 +15,11 @@ package pubsub import ( + "context" "io" "sync" "time" - "context" - vkit "cloud.google.com/go/pubsub/apiv1" "cloud.google.com/go/pubsub/internal/distribution" gax "github.com/googleapis/gax-go" diff --git a/pubsub/iterator_test.go b/pubsub/iterator_test.go index bfbd4df9f13b..6ed4fb64546a 100644 --- a/pubsub/iterator_test.go +++ b/pubsub/iterator_test.go @@ -15,6 +15,7 @@ package pubsub import ( + "context" "errors" "fmt" "reflect" @@ -23,8 +24,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/pubsub/pstest" "google.golang.org/api/option" diff --git a/pubsub/loadtest/benchmark_test.go b/pubsub/loadtest/benchmark_test.go index 699a9dd0dcb3..885caa2d5bdf 100644 --- a/pubsub/loadtest/benchmark_test.go +++ b/pubsub/loadtest/benchmark_test.go @@ -19,14 +19,13 @@ package loadtest // go test -bench . -cpu 1 import ( + "context" "log" "sync" "sync/atomic" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/pubsub" "google.golang.org/api/option" diff --git a/pubsub/loadtest/loadtest.go b/pubsub/loadtest/loadtest.go index d2733bf2d051..1daa21e15e85 100644 --- a/pubsub/loadtest/loadtest.go +++ b/pubsub/loadtest/loadtest.go @@ -20,6 +20,7 @@ package loadtest import ( "bytes" + "context" "errors" "log" "runtime" @@ -28,8 +29,6 @@ import ( "sync/atomic" "time" - "context" - "cloud.google.com/go/pubsub" pb "cloud.google.com/go/pubsub/loadtest/pb" "github.com/golang/protobuf/ptypes" diff --git a/pubsub/mock_test.go b/pubsub/mock_test.go index eb16d593f2d7..52da17407cf6 100644 --- a/pubsub/mock_test.go +++ b/pubsub/mock_test.go @@ -17,12 +17,11 @@ package pubsub // This file provides a mock in-memory pubsub server for streaming pull testing. import ( + "context" "io" "sync" "time" - "context" - "cloud.google.com/go/internal/testutil" emptypb "github.com/golang/protobuf/ptypes/empty" pb "google.golang.org/genproto/googleapis/pubsub/v1" diff --git a/pubsub/pstest/fake.go b/pubsub/pstest/fake.go index 2fd01585e2a3..448c4c93287a 100644 --- a/pubsub/pstest/fake.go +++ b/pubsub/pstest/fake.go @@ -23,6 +23,7 @@ package pstest import ( + "context" "fmt" "io" "path" @@ -32,8 +33,6 @@ import ( "sync/atomic" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/ptypes" durpb "github.com/golang/protobuf/ptypes/duration" diff --git a/pubsub/pstest/fake_test.go b/pubsub/pstest/fake_test.go index fad165400f76..b1c99bca4054 100644 --- a/pubsub/pstest/fake_test.go +++ b/pubsub/pstest/fake_test.go @@ -15,14 +15,13 @@ package pstest import ( + "context" "fmt" "io" "sync" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "github.com/golang/protobuf/ptypes" pb "google.golang.org/genproto/googleapis/pubsub/v1" diff --git a/pubsub/pstest_test.go b/pubsub/pstest_test.go index 1cefb4fa3a46..0a1e4c376f16 100644 --- a/pubsub/pstest_test.go +++ b/pubsub/pstest_test.go @@ -15,12 +15,11 @@ package pubsub_test import ( + "context" "strconv" "sync" "testing" - "context" - "cloud.google.com/go/pubsub" "cloud.google.com/go/pubsub/pstest" "google.golang.org/api/option" diff --git a/pubsub/pubsub.go b/pubsub/pubsub.go index 392eced5051e..83f6731d15aa 100644 --- a/pubsub/pubsub.go +++ b/pubsub/pubsub.go @@ -15,13 +15,12 @@ package pubsub // import "cloud.google.com/go/pubsub" import ( + "context" "fmt" "os" "runtime" "time" - "context" - "cloud.google.com/go/internal/version" vkit "cloud.google.com/go/pubsub/apiv1" "google.golang.org/api/option" diff --git a/pubsub/pullstream.go b/pubsub/pullstream.go index 013dfe039f0a..5a50ff99fab5 100644 --- a/pubsub/pullstream.go +++ b/pubsub/pullstream.go @@ -15,12 +15,11 @@ package pubsub import ( + "context" "io" "sync" "time" - "context" - gax "github.com/googleapis/gax-go" pb "google.golang.org/genproto/googleapis/pubsub/v1" "google.golang.org/grpc" diff --git a/pubsub/pullstream_test.go b/pubsub/pullstream_test.go index 1e7c79e35f0c..059480844caa 100644 --- a/pubsub/pullstream_test.go +++ b/pubsub/pullstream_test.go @@ -15,9 +15,8 @@ package pubsub import ( - "testing" - "context" + "testing" gax "github.com/googleapis/gax-go" pb "google.golang.org/genproto/googleapis/pubsub/v1" diff --git a/pubsub/snapshot.go b/pubsub/snapshot.go index 56138dae8903..d662f0d20e0f 100644 --- a/pubsub/snapshot.go +++ b/pubsub/snapshot.go @@ -15,12 +15,11 @@ package pubsub import ( + "context" "fmt" "strings" "time" - "context" - "github.com/golang/protobuf/ptypes" pb "google.golang.org/genproto/googleapis/pubsub/v1" ) diff --git a/pubsub/streaming_pull_test.go b/pubsub/streaming_pull_test.go index 67a2871bb5a9..ab382e76e1e0 100644 --- a/pubsub/streaming_pull_test.go +++ b/pubsub/streaming_pull_test.go @@ -19,6 +19,7 @@ package pubsub // TODO(jba): test that when all messages expire, Stop returns. import ( + "context" "io" "strconv" "sync" @@ -26,8 +27,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" tspb "github.com/golang/protobuf/ptypes/timestamp" "github.com/google/go-cmp/cmp" diff --git a/pubsub/subscription.go b/pubsub/subscription.go index a725c3f818dd..09f9dbc49462 100644 --- a/pubsub/subscription.go +++ b/pubsub/subscription.go @@ -15,6 +15,7 @@ package pubsub import ( + "context" "errors" "fmt" "io" @@ -22,8 +23,6 @@ import ( "sync" "time" - "context" - "cloud.google.com/go/iam" "cloud.google.com/go/internal/optional" "github.com/golang/protobuf/ptypes" diff --git a/pubsub/subscription_test.go b/pubsub/subscription_test.go index 655a79016ad3..4ff5426ace6e 100644 --- a/pubsub/subscription_test.go +++ b/pubsub/subscription_test.go @@ -15,12 +15,11 @@ package pubsub import ( + "context" "fmt" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "cloud.google.com/go/pubsub/pstest" "google.golang.org/api/iterator" diff --git a/pubsub/timeout_test.go b/pubsub/timeout_test.go index a406787bef24..3418011d63bc 100644 --- a/pubsub/timeout_test.go +++ b/pubsub/timeout_test.go @@ -15,13 +15,12 @@ package pubsub import ( + "context" "log" "sync/atomic" "testing" "time" - "context" - "cloud.google.com/go/pubsub/pstest" "google.golang.org/api/option" "google.golang.org/grpc" diff --git a/pubsub/topic.go b/pubsub/topic.go index 7d9286765692..a9dc97e2187d 100644 --- a/pubsub/topic.go +++ b/pubsub/topic.go @@ -15,6 +15,7 @@ package pubsub import ( + "context" "errors" "fmt" "runtime" @@ -22,8 +23,6 @@ import ( "sync" "time" - "context" - "cloud.google.com/go/iam" "github.com/golang/protobuf/proto" gax "github.com/googleapis/gax-go" diff --git a/pubsub/topic_test.go b/pubsub/topic_test.go index 3250bb684f43..d6cd0ecf4b30 100644 --- a/pubsub/topic_test.go +++ b/pubsub/topic_test.go @@ -15,12 +15,11 @@ package pubsub import ( + "context" "fmt" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" "google.golang.org/api/iterator" "google.golang.org/api/option" diff --git a/rpcreplay/fake_test.go b/rpcreplay/fake_test.go index a30f68e094e3..837ab3d6549c 100644 --- a/rpcreplay/fake_test.go +++ b/rpcreplay/fake_test.go @@ -15,12 +15,11 @@ package rpcreplay import ( + "context" "io" "log" "net" - "context" - pb "cloud.google.com/go/rpcreplay/proto/intstore" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/rpcreplay/rpcreplay.go b/rpcreplay/rpcreplay.go index 848ff79ae866..215b9686f314 100644 --- a/rpcreplay/rpcreplay.go +++ b/rpcreplay/rpcreplay.go @@ -16,6 +16,7 @@ package rpcreplay import ( "bufio" + "context" "encoding/binary" "errors" "fmt" @@ -24,8 +25,6 @@ import ( "os" "sync" - "context" - pb "cloud.google.com/go/rpcreplay/proto/rpcreplay" "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" diff --git a/rpcreplay/rpcreplay_test.go b/rpcreplay/rpcreplay_test.go index 623c71924328..64616c40b6a8 100644 --- a/rpcreplay/rpcreplay_test.go +++ b/rpcreplay/rpcreplay_test.go @@ -16,13 +16,12 @@ package rpcreplay import ( "bytes" + "context" "errors" "io" "strings" "testing" - "context" - "cloud.google.com/go/internal/testutil" ipb "cloud.google.com/go/rpcreplay/proto/intstore" rpb "cloud.google.com/go/rpcreplay/proto/rpcreplay" diff --git a/spanner/batch.go b/spanner/batch.go index dbad69c8bede..a7a6223b6e8d 100644 --- a/spanner/batch.go +++ b/spanner/batch.go @@ -18,12 +18,11 @@ package spanner import ( "bytes" + "context" "encoding/gob" "log" "time" - "context" - "github.com/golang/protobuf/proto" sppb "google.golang.org/genproto/googleapis/spanner/v1" ) diff --git a/spanner/big_pdml_test.go b/spanner/big_pdml_test.go index 1d3e8047968c..262ededdc850 100644 --- a/spanner/big_pdml_test.go +++ b/spanner/big_pdml_test.go @@ -19,10 +19,9 @@ package spanner import ( + "context" "fmt" "testing" - - "context" ) func TestBigPDML(t *testing.T) { diff --git a/spanner/client.go b/spanner/client.go index fd7e4fb1c859..44ffbac0decc 100644 --- a/spanner/client.go +++ b/spanner/client.go @@ -17,13 +17,12 @@ limitations under the License. package spanner import ( + "context" "fmt" "regexp" "sync/atomic" "time" - "context" - "cloud.google.com/go/internal/version" "google.golang.org/api/option" gtransport "google.golang.org/api/transport/grpc" diff --git a/spanner/errors.go b/spanner/errors.go index 037c9d1473d6..fb58ae0817d9 100644 --- a/spanner/errors.go +++ b/spanner/errors.go @@ -17,9 +17,8 @@ limitations under the License. package spanner import ( - "fmt" - "context" + "fmt" "google.golang.org/grpc" "google.golang.org/grpc/codes" diff --git a/spanner/errors_test.go b/spanner/errors_test.go index c5c40d584a6a..9dd7f7f01660 100644 --- a/spanner/errors_test.go +++ b/spanner/errors_test.go @@ -17,11 +17,10 @@ limitations under the License. package spanner import ( + "context" "errors" "testing" - "context" - "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/spanner/examples_test.go b/spanner/examples_test.go index d8e35306879c..e8bb1bb75989 100644 --- a/spanner/examples_test.go +++ b/spanner/examples_test.go @@ -17,13 +17,12 @@ limitations under the License. package spanner_test import ( + "context" "errors" "fmt" "sync" "time" - "context" - "cloud.google.com/go/spanner" "google.golang.org/api/iterator" sppb "google.golang.org/genproto/googleapis/spanner/v1" diff --git a/spanner/go17_test.go b/spanner/go17_test.go index e7f776c5cd2d..325349a7c4f3 100644 --- a/spanner/go17_test.go +++ b/spanner/go17_test.go @@ -17,12 +17,11 @@ package spanner import ( + "context" "reflect" "testing" "time" - "context" - "cloud.google.com/go/civil" proto "github.com/golang/protobuf/proto" proto3 "github.com/golang/protobuf/ptypes/struct" diff --git a/spanner/go18.go b/spanner/go18.go index f99ce5c18f25..9f09bf308174 100644 --- a/spanner/go18.go +++ b/spanner/go18.go @@ -17,9 +17,8 @@ package spanner import ( - "fmt" - "context" + "fmt" "go.opencensus.io/stats" "go.opencensus.io/stats/view" diff --git a/spanner/integration_test.go b/spanner/integration_test.go index 1887eb681418..f9a231e16f46 100644 --- a/spanner/integration_test.go +++ b/spanner/integration_test.go @@ -17,6 +17,7 @@ limitations under the License. package spanner import ( + "context" "errors" "flag" "fmt" @@ -29,8 +30,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/civil" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/internal/uid" diff --git a/spanner/internal/testutil/mockclient.go b/spanner/internal/testutil/mockclient.go index 885caba9afe0..c2d498afc811 100644 --- a/spanner/internal/testutil/mockclient.go +++ b/spanner/internal/testutil/mockclient.go @@ -17,14 +17,13 @@ limitations under the License. package testutil import ( + "context" "errors" "fmt" "sync" "testing" "time" - "context" - "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes/empty" proto3 "github.com/golang/protobuf/ptypes/struct" diff --git a/spanner/internal/testutil/mockserver.go b/spanner/internal/testutil/mockserver.go index f85ef521e17c..b5a6f5e505fd 100644 --- a/spanner/internal/testutil/mockserver.go +++ b/spanner/internal/testutil/mockserver.go @@ -17,6 +17,7 @@ limitations under the License. package testutil import ( + "context" "encoding/binary" "fmt" "io" @@ -25,8 +26,6 @@ import ( "testing" "time" - "context" - "github.com/golang/protobuf/ptypes/empty" proto3 "github.com/golang/protobuf/ptypes/struct" pbt "github.com/golang/protobuf/ptypes/timestamp" diff --git a/spanner/oc_test.go b/spanner/oc_test.go index e72adc41879e..dbe93e7ff1e7 100644 --- a/spanner/oc_test.go +++ b/spanner/oc_test.go @@ -17,11 +17,10 @@ package spanner import ( + "context" "testing" "time" - "context" - "cloud.google.com/go/internal/testutil" stestutil "cloud.google.com/go/spanner/internal/testutil" "google.golang.org/api/option" diff --git a/spanner/pdml.go b/spanner/pdml.go index bf47b3682df6..4beb7913f975 100644 --- a/spanner/pdml.go +++ b/spanner/pdml.go @@ -15,9 +15,8 @@ package spanner import ( - "time" - "context" + "time" "google.golang.org/api/iterator" sppb "google.golang.org/genproto/googleapis/spanner/v1" diff --git a/spanner/pdml_test.go b/spanner/pdml_test.go index 202368ad3787..4c5a743ef149 100644 --- a/spanner/pdml_test.go +++ b/spanner/pdml_test.go @@ -15,11 +15,10 @@ package spanner import ( + "context" "io" "testing" - "context" - "cloud.google.com/go/spanner/internal/testutil" sppb "google.golang.org/genproto/googleapis/spanner/v1" "google.golang.org/grpc/codes" diff --git a/spanner/read.go b/spanner/read.go index cf1a9107b781..8d23892e8a03 100644 --- a/spanner/read.go +++ b/spanner/read.go @@ -18,13 +18,12 @@ package spanner import ( "bytes" + "context" "io" "log" "sync/atomic" "time" - "context" - "cloud.google.com/go/internal/protostruct" proto "github.com/golang/protobuf/proto" proto3 "github.com/golang/protobuf/ptypes/struct" diff --git a/spanner/read_test.go b/spanner/read_test.go index bdd2a05ef739..2c661b372ea5 100644 --- a/spanner/read_test.go +++ b/spanner/read_test.go @@ -17,6 +17,7 @@ limitations under the License. package spanner import ( + "context" "errors" "fmt" "io" @@ -24,8 +25,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/spanner/internal/testutil" "github.com/golang/protobuf/proto" proto3 "github.com/golang/protobuf/ptypes/struct" diff --git a/spanner/retry.go b/spanner/retry.go index c5202dbc302d..08ae920db366 100644 --- a/spanner/retry.go +++ b/spanner/retry.go @@ -17,12 +17,11 @@ limitations under the License. package spanner import ( + "context" "fmt" "strings" "time" - "context" - "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" edpb "google.golang.org/genproto/googleapis/rpc/errdetails" diff --git a/spanner/retry_test.go b/spanner/retry_test.go index 1c562bb33895..737bc8475c8f 100644 --- a/spanner/retry_test.go +++ b/spanner/retry_test.go @@ -17,13 +17,12 @@ limitations under the License. package spanner import ( + "context" "errors" "fmt" "testing" "time" - "context" - "github.com/golang/protobuf/proto" "github.com/golang/protobuf/ptypes" edpb "google.golang.org/genproto/googleapis/rpc/errdetails" diff --git a/spanner/session.go b/spanner/session.go index a120422803e3..d058e57b2386 100644 --- a/spanner/session.go +++ b/spanner/session.go @@ -19,6 +19,7 @@ package spanner import ( "container/heap" "container/list" + "context" "fmt" "log" "math/rand" @@ -26,8 +27,6 @@ import ( "sync" "time" - "context" - sppb "google.golang.org/genproto/googleapis/spanner/v1" "google.golang.org/grpc/codes" "google.golang.org/grpc/metadata" diff --git a/spanner/session_test.go b/spanner/session_test.go index 8fb77a005ad1..932d635d2ab6 100644 --- a/spanner/session_test.go +++ b/spanner/session_test.go @@ -19,14 +19,13 @@ package spanner import ( "bytes" "container/heap" + "context" "fmt" "math/rand" "sync" "testing" "time" - "context" - "cloud.google.com/go/spanner/internal/testutil" sppb "google.golang.org/genproto/googleapis/spanner/v1" "google.golang.org/grpc/codes" diff --git a/spanner/transaction.go b/spanner/transaction.go index 0a32e604e75f..1741e35a5629 100644 --- a/spanner/transaction.go +++ b/spanner/transaction.go @@ -17,12 +17,11 @@ limitations under the License. package spanner import ( + "context" "sync" "sync/atomic" "time" - "context" - "google.golang.org/api/iterator" sppb "google.golang.org/genproto/googleapis/spanner/v1" "google.golang.org/grpc" diff --git a/spanner/transaction_test.go b/spanner/transaction_test.go index 72cb12918322..9ac6c7668ebd 100644 --- a/spanner/transaction_test.go +++ b/spanner/transaction_test.go @@ -17,13 +17,12 @@ limitations under the License. package spanner import ( + "context" "errors" "sync" "testing" "time" - "context" - "cloud.google.com/go/spanner/internal/testutil" sppb "google.golang.org/genproto/googleapis/spanner/v1" "google.golang.org/grpc/codes" diff --git a/storage/acl.go b/storage/acl.go index 316ca5aa118d..7855d110ad45 100644 --- a/storage/acl.go +++ b/storage/acl.go @@ -15,11 +15,10 @@ package storage import ( + "context" "net/http" "reflect" - "context" - "cloud.google.com/go/internal/trace" "google.golang.org/api/googleapi" raw "google.golang.org/api/storage/v1" diff --git a/storage/acl_test.go b/storage/acl_test.go index 5400bdcb36d4..9b725127f6c3 100644 --- a/storage/acl_test.go +++ b/storage/acl_test.go @@ -15,11 +15,10 @@ package storage import ( + "context" "net/http" "testing" - "context" - "cloud.google.com/go/internal/testutil" ) diff --git a/storage/bucket.go b/storage/bucket.go index 37ef54454e88..3b0018affeeb 100644 --- a/storage/bucket.go +++ b/storage/bucket.go @@ -15,13 +15,12 @@ package storage import ( + "context" "fmt" "net/http" "reflect" "time" - "context" - "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" "google.golang.org/api/googleapi" diff --git a/storage/copy.go b/storage/copy.go index 56089657c5c2..52162e72d10f 100644 --- a/storage/copy.go +++ b/storage/copy.go @@ -15,11 +15,10 @@ package storage import ( + "context" "errors" "fmt" - "context" - "cloud.google.com/go/internal/trace" raw "google.golang.org/api/storage/v1" ) diff --git a/storage/copy_test.go b/storage/copy_test.go index ad99424a5092..5f151564632f 100644 --- a/storage/copy_test.go +++ b/storage/copy_test.go @@ -15,10 +15,9 @@ package storage import ( + "context" "strings" "testing" - - "context" ) func TestCopyMissingFields(t *testing.T) { diff --git a/storage/example_test.go b/storage/example_test.go index ed58c3871e1f..5162f95c0656 100644 --- a/storage/example_test.go +++ b/storage/example_test.go @@ -15,6 +15,7 @@ package storage_test import ( + "context" "fmt" "hash/crc32" "io" @@ -23,8 +24,6 @@ import ( "os" "time" - "context" - "cloud.google.com/go/storage" "google.golang.org/api/iterator" "google.golang.org/api/option" diff --git a/storage/integration_test.go b/storage/integration_test.go index cc9acb93c887..c7de8cdfdae0 100644 --- a/storage/integration_test.go +++ b/storage/integration_test.go @@ -17,6 +17,7 @@ package storage import ( "bytes" "compress/gzip" + "context" "crypto/md5" "crypto/sha256" "encoding/base64" @@ -38,8 +39,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/httpreplay" "cloud.google.com/go/iam" "cloud.google.com/go/internal/testutil" diff --git a/storage/invoke_test.go b/storage/invoke_test.go index 0350414b77b0..c24e10ffc8dc 100644 --- a/storage/invoke_test.go +++ b/storage/invoke_test.go @@ -15,11 +15,10 @@ package storage import ( + "context" "errors" "testing" - "context" - "google.golang.org/api/googleapi" ) diff --git a/storage/mock_test.go b/storage/mock_test.go index d377e32e1423..af5714305582 100644 --- a/storage/mock_test.go +++ b/storage/mock_test.go @@ -15,6 +15,7 @@ package storage import ( + "context" "encoding/json" "fmt" "io" @@ -23,8 +24,6 @@ import ( "strings" "testing" - "context" - "google.golang.org/api/option" ) diff --git a/storage/notifications.go b/storage/notifications.go index ed3990a5e35c..84619b6d58c7 100644 --- a/storage/notifications.go +++ b/storage/notifications.go @@ -15,12 +15,11 @@ package storage import ( + "context" "errors" "fmt" "regexp" - "context" - "cloud.google.com/go/internal/trace" raw "google.golang.org/api/storage/v1" ) diff --git a/storage/notifications_test.go b/storage/notifications_test.go index 893292cdc080..e96ff4fdef51 100644 --- a/storage/notifications_test.go +++ b/storage/notifications_test.go @@ -15,9 +15,8 @@ package storage import ( - "testing" - "context" + "testing" "cloud.google.com/go/internal/testutil" raw "google.golang.org/api/storage/v1" diff --git a/storage/oc_test.go b/storage/oc_test.go index fa7388663156..7bb9d12bbe6d 100644 --- a/storage/oc_test.go +++ b/storage/oc_test.go @@ -17,9 +17,8 @@ package storage import ( - "testing" - "context" + "testing" "cloud.google.com/go/internal/testutil" ) diff --git a/storage/reader.go b/storage/reader.go index 7cbae63fe3ea..33c5d8792bb4 100644 --- a/storage/reader.go +++ b/storage/reader.go @@ -15,6 +15,7 @@ package storage import ( + "context" "errors" "fmt" "hash/crc32" @@ -27,8 +28,6 @@ import ( "strings" "time" - "context" - "cloud.google.com/go/internal/trace" "google.golang.org/api/googleapi" ) diff --git a/storage/reader_test.go b/storage/reader_test.go index e0e061d9fd9b..47dbf014d17c 100644 --- a/storage/reader_test.go +++ b/storage/reader_test.go @@ -15,6 +15,7 @@ package storage import ( + "context" "errors" "fmt" "io" @@ -24,8 +25,6 @@ import ( "strings" "testing" - "context" - "google.golang.org/api/option" ) diff --git a/storage/storage.go b/storage/storage.go index 06e013a4805a..6c62e3e1d82f 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -16,6 +16,7 @@ package storage import ( "bytes" + "context" "crypto" "crypto/rand" "crypto/rsa" @@ -36,8 +37,6 @@ import ( "time" "unicode/utf8" - "context" - "cloud.google.com/go/internal/optional" "cloud.google.com/go/internal/trace" "cloud.google.com/go/internal/version" diff --git a/storage/storage_test.go b/storage/storage_test.go index e7b82279b18f..6806472ec170 100644 --- a/storage/storage_test.go +++ b/storage/storage_test.go @@ -15,6 +15,7 @@ package storage import ( + "context" "crypto/tls" "encoding/json" "fmt" @@ -30,8 +31,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/iam" "cloud.google.com/go/internal/testutil" "google.golang.org/api/iterator" diff --git a/storage/writer.go b/storage/writer.go index c2d8bb085a25..3a58c404e0df 100644 --- a/storage/writer.go +++ b/storage/writer.go @@ -15,6 +15,7 @@ package storage import ( + "context" "encoding/base64" "errors" "fmt" @@ -22,8 +23,6 @@ import ( "sync" "unicode/utf8" - "context" - "google.golang.org/api/googleapi" raw "google.golang.org/api/storage/v1" ) diff --git a/storage/writer_test.go b/storage/writer_test.go index 24ee332adfd0..7ac9b7ef5095 100644 --- a/storage/writer_test.go +++ b/storage/writer_test.go @@ -15,14 +15,13 @@ package storage import ( + "context" "crypto/sha256" "encoding/base64" "net/http" "strings" "testing" - "context" - "cloud.google.com/go/internal/testutil" "google.golang.org/api/googleapi" "google.golang.org/api/option" diff --git a/trace/grpc.go b/trace/grpc.go index 42626bb59f0c..e7c003106cbc 100644 --- a/trace/grpc.go +++ b/trace/grpc.go @@ -15,11 +15,10 @@ package trace import ( + "context" "encoding/hex" "fmt" - "context" - "cloud.google.com/go/internal/tracecontext" "google.golang.org/grpc" "google.golang.org/grpc/metadata" diff --git a/trace/grpc_test.go b/trace/grpc_test.go index 1d0e939f86af..51ba2ed5d0a9 100644 --- a/trace/grpc_test.go +++ b/trace/grpc_test.go @@ -15,6 +15,7 @@ package trace import ( + "context" "io/ioutil" "log" "net" @@ -22,8 +23,6 @@ import ( "strings" "testing" - "context" - pb "cloud.google.com/go/trace/testdata/helloworld" "google.golang.org/grpc" ) diff --git a/trace/trace.go b/trace/trace.go index 1d5f21c9e776..7a11de952764 100644 --- a/trace/trace.go +++ b/trace/trace.go @@ -16,6 +16,7 @@ package trace // import "cloud.google.com/go/trace" import ( + "context" "crypto/rand" "encoding/binary" "encoding/json" @@ -29,8 +30,6 @@ import ( "sync/atomic" "time" - "context" - api "google.golang.org/api/cloudtrace/v1" "google.golang.org/api/gensupport" "google.golang.org/api/option" diff --git a/trace/trace_test.go b/trace/trace_test.go index a1acc0070e6a..4992533c3354 100644 --- a/trace/trace_test.go +++ b/trace/trace_test.go @@ -15,6 +15,7 @@ package trace import ( + "context" "encoding/json" "errors" "fmt" @@ -27,8 +28,6 @@ import ( "testing" "time" - "context" - "cloud.google.com/go/datastore" "cloud.google.com/go/internal/testutil" "cloud.google.com/go/storage" diff --git a/translate/examples_test.go b/translate/examples_test.go index 0fecbeba2356..2e96b068ea57 100644 --- a/translate/examples_test.go +++ b/translate/examples_test.go @@ -15,9 +15,8 @@ package translate_test import ( - "fmt" - "context" + "fmt" "cloud.google.com/go/translate" "golang.org/x/text/language" diff --git a/translate/internal/translate/v2/translate-nov2016-gen.go b/translate/internal/translate/v2/translate-nov2016-gen.go index fe14418f1539..9c8298d45a8f 100644 --- a/translate/internal/translate/v2/translate-nov2016-gen.go +++ b/translate/internal/translate/v2/translate-nov2016-gen.go @@ -25,6 +25,7 @@ package translate // import "cloud.google.com/go/translate/internal/translate/v2 import ( "bytes" + "context" "encoding/json" "errors" "fmt" @@ -34,8 +35,6 @@ import ( "strconv" "strings" - "context" - gensupport "google.golang.org/api/gensupport" googleapi "google.golang.org/api/googleapi" ) diff --git a/translate/translate.go b/translate/translate.go index 3d7cb768c1f3..91ffc0ad6a5b 100644 --- a/translate/translate.go +++ b/translate/translate.go @@ -17,11 +17,10 @@ package translate import ( + "context" "fmt" "net/http" - "context" - "cloud.google.com/go/internal/version" raw "cloud.google.com/go/translate/internal/translate/v2" "golang.org/x/text/language" diff --git a/translate/translate_test.go b/translate/translate_test.go index 1667c0855e1a..da744f792817 100644 --- a/translate/translate_test.go +++ b/translate/translate_test.go @@ -15,6 +15,7 @@ package translate import ( + "context" "fmt" "io/ioutil" "log" @@ -25,8 +26,6 @@ import ( "sync" "testing" - "context" - "cloud.google.com/go/internal/testutil" "golang.org/x/text/language" "google.golang.org/api/option" diff --git a/vision/apiv1/client_test.go b/vision/apiv1/client_test.go index 61d6f31df1fb..698a829ee468 100644 --- a/vision/apiv1/client_test.go +++ b/vision/apiv1/client_test.go @@ -15,12 +15,11 @@ package vision import ( + "context" "fmt" "reflect" "testing" - "context" - "github.com/golang/protobuf/proto" pb "google.golang.org/genproto/googleapis/cloud/vision/v1" "google.golang.org/genproto/googleapis/rpc/status" diff --git a/vision/apiv1/examples_test.go b/vision/apiv1/examples_test.go index 92861bdc05dc..94650c99e041 100644 --- a/vision/apiv1/examples_test.go +++ b/vision/apiv1/examples_test.go @@ -15,11 +15,10 @@ package vision_test import ( + "context" "fmt" "os" - "context" - vision "cloud.google.com/go/vision/apiv1" pb "google.golang.org/genproto/googleapis/cloud/vision/v1" )