Skip to content

Commit c765d26

Browse files
committed
Merge branch 'feature-refactor'
2 parents 6f6efa0 + 844855e commit c765d26

39 files changed

+2398
-521
lines changed

.circleci/config.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
version: 2.1
2+
3+
executors:
4+
golang:
5+
parameters:
6+
version:
7+
description: Go version
8+
type: string
9+
docker:
10+
- image: circleci/golang:<< parameters.version >>
11+
12+
commands:
13+
test:
14+
steps:
15+
- run: make
16+
- run: make test
17+
18+
workflows:
19+
test:
20+
jobs:
21+
- go1_9
22+
- go1_10
23+
- go1_11
24+
- go1_12
25+
26+
jobs:
27+
go1_12: &template
28+
executor:
29+
name: golang
30+
version: "1.12"
31+
steps:
32+
- checkout
33+
- test
34+
35+
go1_11:
36+
<<: *template
37+
executor:
38+
name: golang
39+
version: "1.11"
40+
41+
go1_10: &nomod_template
42+
<<: *template
43+
environment:
44+
GO111MODULE: off
45+
GO_COMMAND: vgo
46+
executor:
47+
name: golang
48+
version: "1.10"
49+
working_directory: /go/src/github.com/gbrlsnchs/jwt
50+
steps:
51+
- checkout
52+
- run: go get -u golang.org/x/crypto/ed25519
53+
- run: go get -u golang.org/x/xerrors
54+
- test
55+
56+
go1_9:
57+
<<: *nomod_template
58+
executor:
59+
name: golang
60+
version: "1.9"

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

Makefile

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,19 @@
1-
install: export GO111MODULE := on
2-
install:
3-
current_dir := ${PWD}
4-
@cd ${GOPATH}
5-
go get github.com/golangci/golangci-lint/cmd/[email protected]
1+
export GO111MODULE ?= on
2+
3+
all: export GO111MODULE := off
4+
all:
65
go get -u golang.org/x/tools/cmd/goimports
6+
go get -u golang.org/x/lint/golint
77

8-
lint: golint_cmd := golint -set_exit_status
9-
lint:
10-
@echo "+++ 'lint' (${golint_cmd})"
11-
@${golint_cmd}
8+
fix:
9+
@goimports -w *.go
1210

13-
test-units: export GO111MODULE := on
14-
test-units: go_test_flags := -v -coverprofile=c.out
15-
ifdef GO_TEST_RUN
16-
test-units: go_test_flags += -run=${GO_TEST_RUN}
17-
endif
18-
test-units: GO_TEST_TARGET ?= ./...
19-
test-units: go_test_cmd := go test ${go_test_flags} ${GO_TEST_TARGET}
20-
test-units:
21-
@echo "+++ 'test-units' (${go_test_cmd})"
22-
@${go_test_cmd}
11+
lint:
12+
@! goimports -d . | grep -vF "no errors"
13+
@golint -set_exit_status ./...
2314

24-
test-cover: export GO111MODULE := on
25-
test-cover: go_tool_cover := go tool cover -func=c.out
26-
test-cover:
27-
@echo "+++ 'test-cover' (${go_tool_cover})"
28-
@${go_tool_cover}
15+
bench:
16+
@go test -v -run=^$$ -bench=.
2917

30-
test: test-units lint
18+
test: lint
19+
@go test -v ./...

0 commit comments

Comments
 (0)