From eb131df511cb23a48ef61e059ef560a5a0112783 Mon Sep 17 00:00:00 2001 From: pei0804 Date: Thu, 21 Mar 2019 16:29:17 +0900 Subject: [PATCH 1/3] fix govet error --- operation_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operation_test.go b/operation_test.go index 0da405edc..ad7fa3bcf 100644 --- a/operation_test.go +++ b/operation_test.go @@ -544,7 +544,7 @@ func TestParseParamCommentByEnums(t *testing.T) { assert.Equal(t, expected, string(b)) } -func TestlParseParamCommentByMaxLength(t *testing.T) { +func TestParseParamCommentByMaxLength(t *testing.T) { comment := `@Param some_id query string true "Some ID" MaxLength(10)` operation := NewOperation() err := operation.ParseComment(comment, nil) From fc5c8b2e5371633e1b67af8cc260d4d22bed2198 Mon Sep 17 00:00:00 2001 From: pei0804 Date: Thu, 21 Mar 2019 16:38:51 +0900 Subject: [PATCH 2/3] add go vet check --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index f4cc74e6b..b11c0a61d 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,7 @@ lint: fi for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done; + go vet .PHONY: fmt fmt: From 85c12fdf4c056475e3389ae3d0b44d69a234daf1 Mon Sep 17 00:00:00 2001 From: pei0804 Date: Thu, 21 Mar 2019 19:50:10 +0900 Subject: [PATCH 3/3] add target and vet step --- .travis.yml | 1 + Makefile | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c970f6af5..a19e80229 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ install: script: - make fmt-check - make lint + - make vet - make build - make test diff --git a/Makefile b/Makefile index fa6eb8975..0dc50265a 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ GOCLEAN:=$(GOCMD) clean GOTEST:=$(GOCMD) test GOGET:=$(GOCMD) get GOLIST:=$(GOCMD) list +GOVET:=$(GOCMD) vet BINARY_NAME:=swag PACKAGES:=$(shell $(GOLIST) ./...) @@ -55,7 +56,10 @@ lint: fi for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done; - go vet + +.PHONY: vet +vet: + $(GOVET) $(PACKAGES) .PHONY: fmt fmt: