Skip to content

Commit dec4d0a

Browse files
committed
Updated goimports; did make format; go mod tidy.
Main change is the import alias: golang/go#28428 Quite annoying but nothing much we can do. Signed-off-by: Bartek Plotka <[email protected]>
1 parent 7a767ef commit dec4d0a

File tree

33 files changed

+96
-94
lines changed

33 files changed

+96
-94
lines changed

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
PREFIX ?= $(shell pwd)
2-
DIRECTORIES ?= $(shell find . -path './*' -prune -type d -not -path "./vendor")
2+
FILES_TO_FMT ?= $(shell find . -path ./vendor -prune -o -name '*.go' -print)
3+
34
DOCKER_IMAGE_NAME ?= thanos
45
DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD))-$(shell date +%Y-%m-%d)-$(shell git rev-parse --short HEAD)
56

@@ -18,7 +19,7 @@ ERRCHECK_VERSION ?= e14f8d59a22d460d56c5ee92507cd94c78fbf274
1819
LICHE ?= $(GOBIN)/liche-$(LICHE_VERSION)
1920
LICHE_VERSION ?= 2a2e6e56f6c615c17b2e116669c4cdb31b5453f3
2021
GOIMPORTS ?= $(GOBIN)/goimports-$(GOIMPORTS_VERSION)
21-
GOIMPORTS_VERSION ?= 1c3d964395ce8f04f3b03b30aaed0b096c08c3c6
22+
GOIMPORTS_VERSION ?= 9d4d845e86f14303813298ede731a971dd65b593
2223
PROMU ?= $(GOBIN)/promu-$(PROMU_VERSION)
2324
# v0.2.0
2425
PROMU_VERSION ?= 264dc36af9ea3103255063497636bd5713e3e9c1
@@ -113,6 +114,11 @@ crossbuild: $(PROMU)
113114
@echo ">> crossbuilding all binaries"
114115
$(PROMU) crossbuild -v
115116

117+
# deps ensures fresh go.mod and go.sum.
118+
.PHONY: deps
119+
deps:
120+
@go mod tidy
121+
116122
# docker builds docker with no tag.
117123
.PHONY: docker
118124
docker: build
@@ -156,7 +162,7 @@ errcheck: $(ERRCHECK)
156162
.PHONY: format
157163
format: $(GOIMPORTS)
158164
@echo ">> formatting code"
159-
@$(GOIMPORTS) -w $(DIRECTORIES)
165+
@$(GOIMPORTS) -w $(FILES_TO_FMT)
160166

161167
# proto generates golang files from Thanos proto files.
162168
.PHONY: proto

benchmark/cmd/thanosbench/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"github.com/go-kit/kit/log"
99
"github.com/prometheus/common/version"
10-
"gopkg.in/alecthomas/kingpin.v2"
10+
kingpin "gopkg.in/alecthomas/kingpin.v2"
1111
"k8s.io/client-go/tools/clientcmd"
1212
)
1313

benchmark/cmd/thanosbench/resources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/pkg/errors"
1111
"github.com/prometheus/common/model"
1212
prom "github.com/prometheus/prometheus/config"
13-
"gopkg.in/yaml.v2"
13+
yaml "gopkg.in/yaml.v2"
1414
appsv1 "k8s.io/api/apps/v1"
1515
v1 "k8s.io/api/core/v1"
1616
rbacv1 "k8s.io/api/rbac/v1"

cmd/thanos/bucket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ import (
2020
"github.com/oklog/run"
2121
"github.com/oklog/ulid"
2222
"github.com/olekukonko/tablewriter"
23-
"github.com/opentracing/opentracing-go"
23+
opentracing "github.com/opentracing/opentracing-go"
2424
"github.com/pkg/errors"
2525
"github.com/prometheus/client_golang/prometheus"
2626
"github.com/prometheus/tsdb/labels"
2727
"golang.org/x/text/language"
2828
"golang.org/x/text/message"
29-
"gopkg.in/alecthomas/kingpin.v2"
29+
kingpin "gopkg.in/alecthomas/kingpin.v2"
3030
)
3131

3232
var (

cmd/thanos/compact.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ import (
2121
"github.com/improbable-eng/thanos/pkg/objstore/client"
2222
"github.com/improbable-eng/thanos/pkg/runutil"
2323
"github.com/oklog/run"
24-
"github.com/opentracing/opentracing-go"
24+
opentracing "github.com/opentracing/opentracing-go"
2525
"github.com/pkg/errors"
2626
"github.com/prometheus/client_golang/prometheus"
2727
"github.com/prometheus/tsdb"
28-
"gopkg.in/alecthomas/kingpin.v2"
28+
kingpin "gopkg.in/alecthomas/kingpin.v2"
2929
)
3030

3131
var (

cmd/thanos/downsample.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ import (
1919
"github.com/improbable-eng/thanos/pkg/runutil"
2020
"github.com/oklog/run"
2121
"github.com/oklog/ulid"
22-
"github.com/opentracing/opentracing-go"
22+
opentracing "github.com/opentracing/opentracing-go"
2323
"github.com/pkg/errors"
2424
"github.com/prometheus/client_golang/prometheus"
2525
"github.com/prometheus/tsdb"
2626
"github.com/prometheus/tsdb/chunkenc"
27-
"gopkg.in/alecthomas/kingpin.v2"
27+
kingpin "gopkg.in/alecthomas/kingpin.v2"
2828
)
2929

3030
func registerDownsample(m map[string]setupFunc, app *kingpin.Application, name string) {

cmd/thanos/flags.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/pkg/errors"
1515
"github.com/prometheus/client_golang/prometheus"
1616
"github.com/prometheus/common/model"
17-
"gopkg.in/alecthomas/kingpin.v2"
17+
kingpin "gopkg.in/alecthomas/kingpin.v2"
1818
)
1919

2020
func regGRPCFlags(cmd *kingpin.CmdClause) (

cmd/thanos/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"github.com/improbable-eng/thanos/pkg/runutil"
2929
"github.com/improbable-eng/thanos/pkg/tracing"
3030
"github.com/oklog/run"
31-
"github.com/opentracing/opentracing-go"
31+
opentracing "github.com/opentracing/opentracing-go"
3232
"github.com/pkg/errors"
3333
"github.com/prometheus/client_golang/prometheus"
3434
"github.com/prometheus/client_golang/prometheus/promhttp"

cmd/thanos/receive.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import (
1818
"github.com/improbable-eng/thanos/pkg/store"
1919
"github.com/improbable-eng/thanos/pkg/store/storepb"
2020
"github.com/oklog/run"
21-
"github.com/opentracing/opentracing-go"
21+
opentracing "github.com/opentracing/opentracing-go"
2222
"github.com/pkg/errors"
2323
"github.com/prometheus/client_golang/prometheus"
2424
"github.com/prometheus/common/model"
2525
"github.com/prometheus/prometheus/storage/tsdb"
2626
"github.com/prometheus/tsdb/labels"
2727
"google.golang.org/grpc"
28-
"gopkg.in/alecthomas/kingpin.v2"
28+
kingpin "gopkg.in/alecthomas/kingpin.v2"
2929
)
3030

3131
func registerReceive(m map[string]setupFunc, app *kingpin.Application, name string) {

cmd/thanos/rule.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import (
3939
"github.com/improbable-eng/thanos/pkg/tracing"
4040
"github.com/improbable-eng/thanos/pkg/ui"
4141
"github.com/oklog/run"
42-
"github.com/opentracing/opentracing-go"
42+
opentracing "github.com/opentracing/opentracing-go"
4343
"github.com/pkg/errors"
4444
"github.com/prometheus/client_golang/prometheus"
4545
"github.com/prometheus/common/model"
@@ -53,7 +53,7 @@ import (
5353
"github.com/prometheus/prometheus/util/strutil"
5454
"github.com/prometheus/tsdb/labels"
5555
"google.golang.org/grpc"
56-
"gopkg.in/alecthomas/kingpin.v2"
56+
kingpin "gopkg.in/alecthomas/kingpin.v2"
5757
)
5858

5959
// registerRule registers a rule command.

cmd/thanos/sidecar.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111

1212
"github.com/go-kit/kit/log"
1313
"github.com/go-kit/kit/log/level"
14-
"github.com/hashicorp/go-version"
14+
version "github.com/hashicorp/go-version"
1515
"github.com/improbable-eng/thanos/pkg/block/metadata"
1616
"github.com/improbable-eng/thanos/pkg/cluster"
1717
"github.com/improbable-eng/thanos/pkg/component"

pkg/cluster/advertise.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@ package cluster
22

33
import (
44
"net"
5-
65
"strconv"
76

8-
"github.com/hashicorp/go-sockaddr"
7+
sockaddr "github.com/hashicorp/go-sockaddr"
98
"github.com/pkg/errors"
109
)
1110

pkg/cluster/cluster_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/fortytw2/leaktest"
1414
"github.com/go-kit/kit/log"
15-
"github.com/hashicorp/go-sockaddr"
15+
sockaddr "github.com/hashicorp/go-sockaddr"
1616
"github.com/improbable-eng/thanos/pkg/runutil"
1717
"github.com/improbable-eng/thanos/pkg/store/storepb"
1818
"github.com/improbable-eng/thanos/pkg/testutil"

pkg/compact/compact_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ package compact
33
import (
44
"bytes"
55
"context"
6-
"github.com/improbable-eng/thanos/pkg/objstore/inmem"
7-
"github.com/oklog/ulid"
86
"path"
97
"testing"
108
"time"
119

10+
"github.com/improbable-eng/thanos/pkg/objstore/inmem"
1211
"github.com/improbable-eng/thanos/pkg/testutil"
12+
"github.com/oklog/ulid"
1313
"github.com/pkg/errors"
1414
)
1515

@@ -57,7 +57,7 @@ func TestSyncer_SyncMetas_HandlesMalformedBlocks(t *testing.T) {
5757
testutil.Ok(t, err)
5858

5959
var fakeChunk bytes.Buffer
60-
fakeChunk.Write([]byte{0,1,2,3})
60+
fakeChunk.Write([]byte{0, 1, 2, 3})
6161
testutil.Ok(t, bkt.Upload(ctx, path.Join(shouldDeleteId.String(), "chunks", "000001"), &fakeChunk))
6262

6363
// Generate 1 block which is older than consistencyDelay but younger than MinimumAgeForRemoval, and which has chunk

pkg/objstore/azure/helpers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func getContainerURL(ctx context.Context, conf Config) (blob.ContainerURL, error
2727
}
2828

2929
p := blob.NewPipeline(c, blob.PipelineOptions{
30-
Retry: retryOptions,
30+
Retry: retryOptions,
3131
Telemetry: blob.TelemetryOptions{Value: "Thanos"},
3232
})
3333
u, err := url.Parse(fmt.Sprintf("https://%s.%s", conf.StorageAccountName, conf.Endpoint))

pkg/objstore/client/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"github.com/improbable-eng/thanos/pkg/objstore/swift"
1616
"github.com/pkg/errors"
1717
"github.com/prometheus/client_golang/prometheus"
18-
"gopkg.in/yaml.v2"
18+
yaml "gopkg.in/yaml.v2"
1919
)
2020

2121
type ObjProvider string

pkg/objstore/cos/cos.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
"github.com/go-kit/kit/log"
1515
"github.com/improbable-eng/thanos/pkg/objstore"
1616
"github.com/improbable-eng/thanos/pkg/runutil"
17-
"github.com/mozillazg/go-cos"
17+
cos "github.com/mozillazg/go-cos"
1818
"github.com/pkg/errors"
1919
yaml "gopkg.in/yaml.v2"
2020
)

pkg/objstore/s3/s3.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ import (
1616
"testing"
1717
"time"
1818

19-
"github.com/go-kit/kit/log/level"
20-
2119
"github.com/go-kit/kit/log"
20+
"github.com/go-kit/kit/log/level"
2221
"github.com/improbable-eng/thanos/pkg/objstore"
2322
"github.com/improbable-eng/thanos/pkg/runutil"
24-
"github.com/minio/minio-go"
23+
minio "github.com/minio/minio-go"
2524
"github.com/minio/minio-go/pkg/credentials"
2625
"github.com/minio/minio-go/pkg/encrypt"
2726
"github.com/pkg/errors"
@@ -37,7 +36,7 @@ const DirDelim = "/"
3736
type Config struct {
3837
Bucket string `yaml:"bucket"`
3938
Endpoint string `yaml:"endpoint"`
40-
Region string `yaml:"region"`
39+
Region string `yaml:"region"`
4140
AccessKey string `yaml:"access_key"`
4241
Insecure bool `yaml:"insecure"`
4342
SignatureV2 bool `yaml:"signature_version2"`

pkg/objstore/swift/swift.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/gophercloud/gophercloud/openstack/objectstorage/v1/objects"
2121
"github.com/gophercloud/gophercloud/pagination"
2222
"github.com/pkg/errors"
23-
"gopkg.in/yaml.v2"
23+
yaml "gopkg.in/yaml.v2"
2424
)
2525

2626
// DirDelim is the delimiter used to model a directory structure in an object store bucket.

pkg/promclient/promclient.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import (
2323

2424
"github.com/go-kit/kit/log"
2525
"github.com/go-kit/kit/log/level"
26-
"github.com/hashicorp/go-version"
26+
version "github.com/hashicorp/go-version"
2727
"github.com/improbable-eng/thanos/pkg/runutil"
2828
"github.com/improbable-eng/thanos/pkg/store/storepb"
2929
"github.com/improbable-eng/thanos/pkg/tracing"

pkg/promclient/promclient_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"time"
1212

1313
"github.com/go-kit/kit/log"
14-
"github.com/hashicorp/go-version"
14+
version "github.com/hashicorp/go-version"
1515
"github.com/improbable-eng/thanos/pkg/runutil"
1616
"github.com/improbable-eng/thanos/pkg/testutil"
1717
"github.com/oklog/ulid"

pkg/query/api/v1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/improbable-eng/thanos/pkg/query"
3333
"github.com/improbable-eng/thanos/pkg/runutil"
3434
"github.com/improbable-eng/thanos/pkg/tracing"
35-
"github.com/opentracing/opentracing-go"
35+
opentracing "github.com/opentracing/opentracing-go"
3636
"github.com/pkg/errors"
3737
"github.com/prometheus/client_golang/prometheus"
3838
"github.com/prometheus/common/model"

pkg/query/api/v1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
"github.com/improbable-eng/thanos/pkg/compact"
3434
"github.com/improbable-eng/thanos/pkg/query"
3535
"github.com/improbable-eng/thanos/pkg/testutil"
36-
"github.com/opentracing/opentracing-go"
36+
opentracing "github.com/opentracing/opentracing-go"
3737
"github.com/prometheus/client_golang/prometheus"
3838
"github.com/prometheus/common/route"
3939
"github.com/prometheus/prometheus/pkg/labels"

pkg/rule/api/v1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
thanosrule "github.com/improbable-eng/thanos/pkg/rule"
1212
"github.com/improbable-eng/thanos/pkg/store/storepb"
1313
"github.com/improbable-eng/thanos/pkg/tracing"
14-
"github.com/opentracing/opentracing-go"
14+
opentracing "github.com/opentracing/opentracing-go"
1515
"github.com/prometheus/client_golang/prometheus"
1616
"github.com/prometheus/common/route"
1717
"github.com/prometheus/prometheus/pkg/labels"

0 commit comments

Comments
 (0)