From 01ff822b114ff1e583283970daab19fe77fd47e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n?= Date: Mon, 24 Sep 2018 23:35:49 +0200 Subject: [PATCH] Fix import grouping (#1080) --- cmd/agent/app/httpserver/thrift-0.9.2/constants.go | 1 + cmd/agent/app/httpserver/thrift-0.9.2/ttypes.go | 1 + cmd/agent/app/servers/server.go | 4 +++- cmd/collector/app/metrics.go | 3 ++- cmd/collector/app/model_consumer.go | 4 +++- cmd/collector/app/service_name_normalizer.go | 4 +++- cmd/ingester/app/consumer/message.go | 4 +++- crossdock/services/mocks/AgentService.go | 4 +++- crossdock/services/mocks/QueryService.go | 6 ++++-- examples/hotrod/cmd/all.go | 4 +++- examples/hotrod/pkg/httperr/httperr.go | 4 +++- examples/hotrod/services/customer/interface.go | 4 +++- examples/hotrod/services/driver/interface.go | 4 +++- examples/hotrod/services/route/interface.go | 6 ++++-- model/converter/thrift/zipkin/process_hashtable.go | 4 +++- model/process.go | 4 +++- model/time.go | 4 +++- pkg/cache/cache.go | 4 +++- pkg/distributedlock/interface.go | 4 +++- .../cassandra/spanstore/dbmodel/log_fields_filter.go | 4 +++- .../storage/cassandra/spanstore/dbmodel/unique_tags.go | 4 +++- plugin/storage/es/spanstore/schema.go | 4 +++- storage/samplingstore/mocks/Store.go | 9 ++++++--- thrift-gen/agent/agent.go | 1 + thrift-gen/agent/constants.go | 1 + thrift-gen/agent/ttypes.go | 1 + thrift-gen/baggage/baggagerestrictionmanager.go | 1 + thrift-gen/baggage/constants.go | 1 + thrift-gen/baggage/ttypes.go | 1 + thrift-gen/jaeger/agent.go | 1 + thrift-gen/jaeger/collector.go | 1 + thrift-gen/jaeger/constants.go | 1 + thrift-gen/jaeger/ttypes.go | 1 + thrift-gen/sampling/constants.go | 1 + thrift-gen/sampling/samplingmanager.go | 1 + thrift-gen/sampling/ttypes.go | 1 + thrift-gen/zipkincore/constants.go | 1 + thrift-gen/zipkincore/ttypes.go | 1 + thrift-gen/zipkincore/zipkincollector.go | 1 + 39 files changed, 85 insertions(+), 25 deletions(-) diff --git a/cmd/agent/app/httpserver/thrift-0.9.2/constants.go b/cmd/agent/app/httpserver/thrift-0.9.2/constants.go index 58f8b1ab63f..44ddd4fd490 100644 --- a/cmd/agent/app/httpserver/thrift-0.9.2/constants.go +++ b/cmd/agent/app/httpserver/thrift-0.9.2/constants.go @@ -20,6 +20,7 @@ package sampling import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/cmd/agent/app/httpserver/thrift-0.9.2/ttypes.go b/cmd/agent/app/httpserver/thrift-0.9.2/ttypes.go index c6698a9ccfd..447b60920e4 100644 --- a/cmd/agent/app/httpserver/thrift-0.9.2/ttypes.go +++ b/cmd/agent/app/httpserver/thrift-0.9.2/ttypes.go @@ -20,6 +20,7 @@ package sampling import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/cmd/agent/app/servers/server.go b/cmd/agent/app/servers/server.go index a27449cba8d..ee5bd22e0af 100644 --- a/cmd/agent/app/servers/server.go +++ b/cmd/agent/app/servers/server.go @@ -14,7 +14,9 @@ package servers -import "io" +import ( + "io" +) // Server is the interface for servers that receive inbound span submissions from client. type Server interface { diff --git a/cmd/collector/app/metrics.go b/cmd/collector/app/metrics.go index 3b725385aad..0894529bb67 100644 --- a/cmd/collector/app/metrics.go +++ b/cmd/collector/app/metrics.go @@ -28,7 +28,8 @@ const ( ) // SpanProcessorMetrics contains all the necessary metrics for the SpanProcessor -type SpanProcessorMetrics struct { //TODO - initialize metrics in the traditional factory way. Initialize map afterward. +type SpanProcessorMetrics struct { + //TODO - initialize metrics in the traditional factory way. Initialize map afterward. // SaveLatency measures how long the actual save to storage takes SaveLatency metrics.Timer // InQueueLatency measures how long the span spends in the queue diff --git a/cmd/collector/app/model_consumer.go b/cmd/collector/app/model_consumer.go index e335147cc84..be0d0f92aff 100644 --- a/cmd/collector/app/model_consumer.go +++ b/cmd/collector/app/model_consumer.go @@ -14,7 +14,9 @@ package app -import "github.com/jaegertracing/jaeger/model" +import ( + "github.com/jaegertracing/jaeger/model" +) // ProcessSpan processes a Domain Model Span type ProcessSpan func(span *model.Span) diff --git a/cmd/collector/app/service_name_normalizer.go b/cmd/collector/app/service_name_normalizer.go index d792ac7a7d8..f2dc6746910 100644 --- a/cmd/collector/app/service_name_normalizer.go +++ b/cmd/collector/app/service_name_normalizer.go @@ -14,7 +14,9 @@ package app -import "strings" +import ( + "strings" +) // NormalizeServiceName converts service name to a lowercase string that is safe to use in metrics func NormalizeServiceName(serviceName string) string { diff --git a/cmd/ingester/app/consumer/message.go b/cmd/ingester/app/consumer/message.go index 3ed64cd87a2..c8075f82c60 100644 --- a/cmd/ingester/app/consumer/message.go +++ b/cmd/ingester/app/consumer/message.go @@ -14,7 +14,9 @@ package consumer -import "github.com/Shopify/sarama" +import ( + "github.com/Shopify/sarama" +) // Message contains the parts of a sarama ConsumerMessage that we care about. type Message interface { diff --git a/crossdock/services/mocks/AgentService.go b/crossdock/services/mocks/AgentService.go index 69f22634407..ee1cc207d5d 100644 --- a/crossdock/services/mocks/AgentService.go +++ b/crossdock/services/mocks/AgentService.go @@ -14,7 +14,9 @@ package mocks -import "github.com/stretchr/testify/mock" +import ( + "github.com/stretchr/testify/mock" +) // AgentService is an autogenerated mock type for the AgentService type type AgentService struct { diff --git a/crossdock/services/mocks/QueryService.go b/crossdock/services/mocks/QueryService.go index 0f95b1fba3b..774f46c20d7 100644 --- a/crossdock/services/mocks/QueryService.go +++ b/crossdock/services/mocks/QueryService.go @@ -14,9 +14,11 @@ package mocks -import "github.com/stretchr/testify/mock" +import ( + "github.com/stretchr/testify/mock" -import ui "github.com/jaegertracing/jaeger/model/json" + ui "github.com/jaegertracing/jaeger/model/json" +) // QueryService is an autogenerated mock type for the QueryService type type QueryService struct { diff --git a/examples/hotrod/cmd/all.go b/examples/hotrod/cmd/all.go index b6aea308810..ca4f32e82bf 100644 --- a/examples/hotrod/cmd/all.go +++ b/examples/hotrod/cmd/all.go @@ -14,7 +14,9 @@ package cmd -import "github.com/spf13/cobra" +import ( + "github.com/spf13/cobra" +) // allCmd represents the all command var allCmd = &cobra.Command{ diff --git a/examples/hotrod/pkg/httperr/httperr.go b/examples/hotrod/pkg/httperr/httperr.go index 9351eea772b..2f92cd93636 100644 --- a/examples/hotrod/pkg/httperr/httperr.go +++ b/examples/hotrod/pkg/httperr/httperr.go @@ -14,7 +14,9 @@ package httperr -import "net/http" +import ( + "net/http" +) // HandleError checks if the error is not nil, writes it to the output // with the specified status code, and returns true. If error is nil it returns false. diff --git a/examples/hotrod/services/customer/interface.go b/examples/hotrod/services/customer/interface.go index 976adc9ac25..f8bc49a8de3 100644 --- a/examples/hotrod/services/customer/interface.go +++ b/examples/hotrod/services/customer/interface.go @@ -14,7 +14,9 @@ package customer -import "context" +import ( + "context" +) // Customer contains data about a customer. type Customer struct { diff --git a/examples/hotrod/services/driver/interface.go b/examples/hotrod/services/driver/interface.go index d20941f4f5e..e6487c4c851 100644 --- a/examples/hotrod/services/driver/interface.go +++ b/examples/hotrod/services/driver/interface.go @@ -14,7 +14,9 @@ package driver -import "context" +import ( + "context" +) // Driver describes a driver and the currentl car location. type Driver struct { diff --git a/examples/hotrod/services/route/interface.go b/examples/hotrod/services/route/interface.go index f65addce24d..46ef091c9a4 100644 --- a/examples/hotrod/services/route/interface.go +++ b/examples/hotrod/services/route/interface.go @@ -14,8 +14,10 @@ package route -import "context" -import "time" +import ( + "context" + "time" +) // Route describes a route between Pickup and Dropoff locations and expected time to arrival. type Route struct { diff --git a/model/converter/thrift/zipkin/process_hashtable.go b/model/converter/thrift/zipkin/process_hashtable.go index ce4ec0583a7..7e1208f6117 100644 --- a/model/converter/thrift/zipkin/process_hashtable.go +++ b/model/converter/thrift/zipkin/process_hashtable.go @@ -14,7 +14,9 @@ package zipkin -import "github.com/jaegertracing/jaeger/model" +import ( + "github.com/jaegertracing/jaeger/model" +) type processHashtable struct { processes map[uint64][]*model.Process diff --git a/model/process.go b/model/process.go index 6b9e1126b2f..145dc9298ea 100644 --- a/model/process.go +++ b/model/process.go @@ -14,7 +14,9 @@ package model -import "io" +import ( + "io" +) // NewProcess creates a new Process for given serviceName and tags. // The tags are sorted in place and kept in the the same array/slice, diff --git a/model/time.go b/model/time.go index 15f28a9ce90..b3c841b698f 100644 --- a/model/time.go +++ b/model/time.go @@ -14,7 +14,9 @@ package model -import "time" +import ( + "time" +) // EpochMicrosecondsAsTime converts microseconds since epoch to time.Time value. func EpochMicrosecondsAsTime(ts uint64) time.Time { diff --git a/pkg/cache/cache.go b/pkg/cache/cache.go index 931f3353f6f..3dcf5d98987 100644 --- a/pkg/cache/cache.go +++ b/pkg/cache/cache.go @@ -14,7 +14,9 @@ package cache -import "time" +import ( + "time" +) // A Cache is a generalized interface to a cache. See cache.LRU for a specific // implementation (bounded cache with LRU eviction) diff --git a/pkg/distributedlock/interface.go b/pkg/distributedlock/interface.go index 50c482dd6a6..fa3e4e773da 100644 --- a/pkg/distributedlock/interface.go +++ b/pkg/distributedlock/interface.go @@ -14,7 +14,9 @@ package distributedlock -import "time" +import ( + "time" +) // Lock uses distributed lock for control of a resource. type Lock interface { diff --git a/plugin/storage/cassandra/spanstore/dbmodel/log_fields_filter.go b/plugin/storage/cassandra/spanstore/dbmodel/log_fields_filter.go index 8bfd11c431b..fec9f957345 100644 --- a/plugin/storage/cassandra/spanstore/dbmodel/log_fields_filter.go +++ b/plugin/storage/cassandra/spanstore/dbmodel/log_fields_filter.go @@ -14,7 +14,9 @@ package dbmodel -import "github.com/jaegertracing/jaeger/model" +import ( + "github.com/jaegertracing/jaeger/model" +) // LogFieldsFilter filters all span.Logs.Fields. type LogFieldsFilter struct { diff --git a/plugin/storage/cassandra/spanstore/dbmodel/unique_tags.go b/plugin/storage/cassandra/spanstore/dbmodel/unique_tags.go index 1f95ac5c531..ccdc9a4de8b 100644 --- a/plugin/storage/cassandra/spanstore/dbmodel/unique_tags.go +++ b/plugin/storage/cassandra/spanstore/dbmodel/unique_tags.go @@ -14,7 +14,9 @@ package dbmodel -import "github.com/jaegertracing/jaeger/model" +import ( + "github.com/jaegertracing/jaeger/model" +) // GetAllUniqueTags creates a list of all unique tags from a set of filtered tags. func GetAllUniqueTags(span *model.Span, tagFilter TagFilter) []TagInsertion { diff --git a/plugin/storage/es/spanstore/schema.go b/plugin/storage/es/spanstore/schema.go index 3f4bd6defb2..e59a54dbc6b 100644 --- a/plugin/storage/es/spanstore/schema.go +++ b/plugin/storage/es/spanstore/schema.go @@ -14,7 +14,9 @@ package spanstore -import "fmt" +import ( + "fmt" +) // TODO: resolve traceID concerns (may not require any changes here) const mapping = `{ diff --git a/storage/samplingstore/mocks/Store.go b/storage/samplingstore/mocks/Store.go index c2732080c41..3270df5f30a 100644 --- a/storage/samplingstore/mocks/Store.go +++ b/storage/samplingstore/mocks/Store.go @@ -14,10 +14,13 @@ package mocks -import "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/model" -import "github.com/stretchr/testify/mock" +import ( + "time" -import "time" + "github.com/stretchr/testify/mock" + + "github.com/jaegertracing/jaeger/cmd/collector/app/sampling/model" +) type Store struct { mock.Mock diff --git a/thrift-gen/agent/agent.go b/thrift-gen/agent/agent.go index 874b14723aa..7ce6521d51d 100644 --- a/thrift-gen/agent/agent.go +++ b/thrift-gen/agent/agent.go @@ -6,6 +6,7 @@ package agent import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" diff --git a/thrift-gen/agent/constants.go b/thrift-gen/agent/constants.go index 3cfe4787f7f..5c3ebdca92b 100644 --- a/thrift-gen/agent/constants.go +++ b/thrift-gen/agent/constants.go @@ -6,6 +6,7 @@ package agent import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" diff --git a/thrift-gen/agent/ttypes.go b/thrift-gen/agent/ttypes.go index 7ad797b0480..5f27c397147 100644 --- a/thrift-gen/agent/ttypes.go +++ b/thrift-gen/agent/ttypes.go @@ -6,6 +6,7 @@ package agent import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" "github.com/jaegertracing/jaeger/thrift-gen/jaeger" "github.com/jaegertracing/jaeger/thrift-gen/zipkincore" diff --git a/thrift-gen/baggage/baggagerestrictionmanager.go b/thrift-gen/baggage/baggagerestrictionmanager.go index 1931cd72c48..69bc8841b39 100644 --- a/thrift-gen/baggage/baggagerestrictionmanager.go +++ b/thrift-gen/baggage/baggagerestrictionmanager.go @@ -6,6 +6,7 @@ package baggage import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/baggage/constants.go b/thrift-gen/baggage/constants.go index 6668424a59c..425a621532d 100644 --- a/thrift-gen/baggage/constants.go +++ b/thrift-gen/baggage/constants.go @@ -6,6 +6,7 @@ package baggage import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/baggage/ttypes.go b/thrift-gen/baggage/ttypes.go index be442fbd91a..c0169dd449e 100644 --- a/thrift-gen/baggage/ttypes.go +++ b/thrift-gen/baggage/ttypes.go @@ -6,6 +6,7 @@ package baggage import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/jaeger/agent.go b/thrift-gen/jaeger/agent.go index db6cac9fc19..172dabded00 100644 --- a/thrift-gen/jaeger/agent.go +++ b/thrift-gen/jaeger/agent.go @@ -6,6 +6,7 @@ package jaeger import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/jaeger/collector.go b/thrift-gen/jaeger/collector.go index d5750bd9bad..f9bd36f7ce8 100644 --- a/thrift-gen/jaeger/collector.go +++ b/thrift-gen/jaeger/collector.go @@ -6,6 +6,7 @@ package jaeger import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/jaeger/constants.go b/thrift-gen/jaeger/constants.go index 250474222a4..414aa673ba9 100644 --- a/thrift-gen/jaeger/constants.go +++ b/thrift-gen/jaeger/constants.go @@ -6,6 +6,7 @@ package jaeger import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/jaeger/ttypes.go b/thrift-gen/jaeger/ttypes.go index b5ddfa64590..836afc1b577 100644 --- a/thrift-gen/jaeger/ttypes.go +++ b/thrift-gen/jaeger/ttypes.go @@ -6,6 +6,7 @@ package jaeger import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/sampling/constants.go b/thrift-gen/sampling/constants.go index 728988b8387..1c6ade8e210 100644 --- a/thrift-gen/sampling/constants.go +++ b/thrift-gen/sampling/constants.go @@ -6,6 +6,7 @@ package sampling import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/sampling/samplingmanager.go b/thrift-gen/sampling/samplingmanager.go index 563e2b4c9e6..1c28aaf0e30 100644 --- a/thrift-gen/sampling/samplingmanager.go +++ b/thrift-gen/sampling/samplingmanager.go @@ -6,6 +6,7 @@ package sampling import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/sampling/ttypes.go b/thrift-gen/sampling/ttypes.go index 3e831af4a65..490c4b07dcd 100644 --- a/thrift-gen/sampling/ttypes.go +++ b/thrift-gen/sampling/ttypes.go @@ -6,6 +6,7 @@ package sampling import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/zipkincore/constants.go b/thrift-gen/zipkincore/constants.go index 0f0b6bc03b7..c84b0fdb309 100644 --- a/thrift-gen/zipkincore/constants.go +++ b/thrift-gen/zipkincore/constants.go @@ -6,6 +6,7 @@ package zipkincore import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/zipkincore/ttypes.go b/thrift-gen/zipkincore/ttypes.go index 8fbf2ad49b2..ed599ae44b9 100644 --- a/thrift-gen/zipkincore/ttypes.go +++ b/thrift-gen/zipkincore/ttypes.go @@ -6,6 +6,7 @@ package zipkincore import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" ) diff --git a/thrift-gen/zipkincore/zipkincollector.go b/thrift-gen/zipkincore/zipkincollector.go index bcc54f36efb..ff35f002bf1 100644 --- a/thrift-gen/zipkincore/zipkincollector.go +++ b/thrift-gen/zipkincore/zipkincollector.go @@ -6,6 +6,7 @@ package zipkincore import ( "bytes" "fmt" + "github.com/apache/thrift/lib/go/thrift" )