http urls monitor.

Makefile 882B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #! /usr/bin/make
  2. GOCMD=$(shell which go)
  3. GOLINT=$(shell which golint)
  4. GOIMPORT=$(shell which goimports)
  5. GOBUILD=$(GOCMD) build
  6. GOCLEAN=$(GOCMD) clean
  7. GOTEST=$(GOCMD) test
  8. GOGET=$(GOCMD) get
  9. GOLIST=$(GOCMD) list
  10. BINARY_NAME=swag
  11. all: test build
  12. build:
  13. $(GOBUILD) -o $(BINARY_NAME) -v ./cmd/...
  14. test:
  15. $(GOTEST) -v ./...
  16. clean:
  17. $(GOCLEAN)
  18. rm -f $(BINARY_NAME)
  19. DIRS=$(shell $(GOLIST) -f {{.Dir}} ./...)
  20. lint:
  21. @for d in $(DIRS) ; do \
  22. if [ "`$(GOIMPORT) -l $$d/*.go | tee /dev/stderr`" ]; then \
  23. echo "^ - Repo contains improperly formatted go files" && echo && exit 1; \
  24. fi \
  25. done
  26. @if [ "`$(GOLINT) ./... | grep -vf .golint_exclude | tee /dev/stderr`" ]; then \
  27. echo "^ - Lint errors!" && echo && exit 1; \
  28. fi
  29. deps:
  30. $(GOGET) -v ./...
  31. $(GOGET) github.com/stretchr/testify/assert
  32. $(GOGET) github.com/golang/lint/golint
  33. $(GOGET) golang.org/x/tools/cmd/goimports