Skip to content

Commit

Permalink
feat: and go vet check (swaggo#336)
Browse files Browse the repository at this point in the history
* fix govet error

* add go vet check

* add target and vet step
  • Loading branch information
pei0804 authored and easonlin404 committed Mar 22, 2019
1 parent d21dc4f commit 009de0c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ install:
script:
- make fmt-check
- make lint
- make vet
- make build
- make test

Expand Down
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) ./...)
Expand Down Expand Up @@ -56,6 +57,10 @@ lint:

for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;

.PHONY: vet
vet:
$(GOVET) $(PACKAGES)

.PHONY: fmt
fmt:
$(GOFMT) -s -w $(GOFILES)
Expand Down
2 changes: 1 addition & 1 deletion operation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 009de0c

Please sign in to comment.