Skip to content

Commit

Permalink
fix(example): fix lint (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
easonlin404 authored Dec 8, 2018
1 parent b5bd45e commit 934068f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 2 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOLIST=$(GOCMD) list
BINARY_NAME=swag
PACKAGES=$(shell $(GOLIST) -f {{.Dir}} ./... | grep -v /example)

all: test build

Expand All @@ -21,16 +22,8 @@ clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)

DIRS=$(shell $(GOLIST) -f {{.Dir}} ./...)
lint:
@for d in $(DIRS) ; do \
if [ "`$(GOIMPORT) -l $$d/*.go | tee /dev/stderr`" ]; then \
echo "^ - Repo contains improperly formatted go files" && echo && exit 1; \
fi \
done
@if [ "`$(GOLINT) ./... | grep -vf .golint_exclude | tee /dev/stderr`" ]; then \
echo "^ - Lint errors!" && echo && exit 1; \
fi
for PKG in $(PACKAGES); do golint -set_exit_status $$PKG || exit 1; done;

deps:
$(GOGET) -v ./...
Expand Down
5 changes: 3 additions & 2 deletions example/celler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ import (
"net/http"

"github.com/gin-gonic/gin"
"github.com/swaggo/gin-swagger"
"github.com/swaggo/gin-swagger/swaggerFiles"
"github.com/swaggo/swag/example/celler/controller"
_ "github.com/swaggo/swag/example/celler/docs"
"github.com/swaggo/swag/example/celler/httputil"

ginSwagger "github.com/swaggo/gin-swagger"
swaggerFiles "github.com/swaggo/gin-swagger/swaggerFiles"
)

// @title Swagger Example API
Expand Down

0 comments on commit 934068f

Please sign in to comment.