Skip to content

Commit cc4f07e

Browse files
chore(*): upgrade docker-go-dev and use new linter (#155)
1 parent 1199b9e commit cc4f07e

4 files changed

Lines changed: 19 additions & 32 deletions

File tree

Makefile

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ endif
1111
BUILD_OS ?=linux darwin windows
1212
BUILD_ARCH ?=amd64 386
1313

14-
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.14.0
14+
DEV_ENV_IMAGE := quay.io/deis/go-dev:0.16.0
1515
DEV_ENV_WORK_DIR := /go/src/${repo_path}
1616
DEV_ENV_PREFIX := docker run --rm -e CGO_ENABLED=0 -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
1717
DEV_ENV_PREFIX_CGO_ENABLED := docker run --rm -e CGO_ENABLED=1 -v ${CURDIR}:${DEV_ENV_WORK_DIR} -w ${DEV_ENV_WORK_DIR}
1818
DEV_ENV_CMD := ${DEV_ENV_PREFIX} ${DEV_ENV_IMAGE}
1919
DIST_DIR := _dist
2020

21-
GO_FILES = $(wildcard *.go)
2221
GO_LDFLAGS = -ldflags "-s -X ${repo_path}/version.BuildVersion=${VERSION}"
23-
GO_PACKAGES = cmd parser cli $(wildcard pkg/*)
24-
GO_PACKAGES_REPO_PATH = $(addprefix $(repo_path)/,$(GO_PACKAGES))
25-
GOFMT = gofmtresult=$$(gofmt -e -l -s ${GO_FILES} ${GO_PACKAGES}); if [[ -n $$gofmtresult ]]; then echo "gofmt errors found in the following files: $${gofmtresult}"; false; fi;
26-
GOTEST = go test --race -v
22+
GOTEST = go test --race
2723

2824
# The tag of the commit
2925
GIT_TAG := $(shell git tag -l --contains HEAD)
@@ -82,17 +78,8 @@ installer: build
8278
&& echo 'See http://docs.deis.io/ for documentation.' \
8379
&& echo"
8480

85-
setup-gotools:
86-
go get -u github.com/golang/lint/golint
87-
go get -u golang.org/x/tools/cmd/cover
88-
go get -u golang.org/x/tools/cmd/vet
89-
9081
test-style:
91-
${DEV_ENV_CMD} bash -c '${GOFMT}'
92-
${DEV_ENV_CMD} sh -c 'go vet $(repo_path) $(GO_PACKAGES_REPO_PATH)'
93-
@for i in $(addsuffix /...,$(GO_PACKAGES)); do \
94-
${DEV_ENV_CMD} golint $$i; \
95-
done
82+
${DEV_ENV_CMD} lint
9683

9784
test: test-style
9885
${DEV_ENV_PREFIX_CGO_ENABLED} ${DEV_ENV_IMAGE} sh -c '${GOTEST} $$(glide nv)'

cmd/apps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ func appURL(s *settings.Settings, appID string) (string, error) {
306306
return expandURL(s.Client.ControllerURL.Host, domains[0].Domain), nil
307307
}
308308

309-
// expandURL expands an app url if neccessary.
309+
// expandURL expands an app url if necessary.
310310
func expandURL(host, u string) string {
311311
if strings.Contains(u, ".") {
312312
// If domain is a full url.

cmd/auth.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func Cancel(username string, password string, yes bool) error {
201201
}
202202
}
203203

204-
if yes == false {
204+
if !yes {
205205
confirm := ""
206206

207207
s, err = settings.Load()
@@ -224,7 +224,7 @@ func Cancel(username string, password string, yes bool) error {
224224
}
225225
}
226226

227-
if yes == false {
227+
if !yes {
228228
fmt.Fprintln(os.Stderr, "Account not changed")
229229
return nil
230230
}
@@ -281,7 +281,7 @@ func Regenerate(username string, all bool) error {
281281
return err
282282
}
283283

284-
if username == "" && all == false {
284+
if username == "" && !all {
285285
s.Client.Token = token
286286

287287
err = s.Save()

settings/settings_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,27 @@ func TestLoadSave(t *testing.T) {
5252
}
5353

5454
tests := []comparison{
55-
comparison{
55+
{
5656
key: false,
5757
expected: s.Client.VerifySSL,
5858
},
59-
comparison{
59+
{
6060
key: "a",
6161
expected: s.Client.Token,
6262
},
63-
comparison{
63+
{
6464
key: "t",
6565
expected: s.Username,
6666
},
67-
comparison{
67+
{
6868
key: "http://foo.bar",
6969
expected: s.Client.ControllerURL.String(),
7070
},
71-
comparison{
71+
{
7272
key: 50,
7373
expected: s.Limit,
7474
},
75-
comparison{
75+
{
7676
key: "Deis Client v" + version.Version,
7777
expected: s.Client.UserAgent,
7878
},
@@ -107,27 +107,27 @@ func TestLoadSave(t *testing.T) {
107107
}
108108

109109
tests = []comparison{
110-
comparison{
110+
{
111111
key: true,
112112
expected: s.Client.VerifySSL,
113113
},
114-
comparison{
114+
{
115115
key: "b",
116116
expected: s.Client.Token,
117117
},
118-
comparison{
118+
{
119119
key: "c",
120120
expected: s.Username,
121121
},
122-
comparison{
122+
{
123123
key: "http://deis.test",
124124
expected: s.Client.ControllerURL.String(),
125125
},
126-
comparison{
126+
{
127127
key: 100,
128128
expected: s.Limit,
129129
},
130-
comparison{
130+
{
131131
key: "Deis Client v" + version.Version,
132132
expected: s.Client.UserAgent,
133133
},

0 commit comments

Comments
 (0)