Skip to content

Instantly share code, notes, and snippets.

@ridhoperdana
Last active June 12, 2019 06:39
Show Gist options
  • Save ridhoperdana/e55066136ad0030111d7dbfe679fdc07 to your computer and use it in GitHub Desktop.
Save ridhoperdana/e55066136ad0030111d7dbfe679fdc07 to your computer and use it in GitHub Desktop.
BINARY=crawler
# Installing dependency
.PHONY: vendor
go mod vendor
# Linter
.PHONY: vendor lint-prepare
lint-prepare:
@echo "Installing golangci-lint"
@go get github.com/golangci/golangci-lint/cmd/golangci-lint
.PHONY: lint
lint: lint-prepare
@echo "Run lint"
@golangci-lint run \
--exclude-use-default=false \
--enable=golint \
--enable=gocyclo \
--enable=goconst \
--enable=unconvert \
./...
# Required service
.PHONY: pubsub-up
pubsub-up:
@docker-compose up -d crawler_pubsub
build: test
go build -o ${BINARY} github.com/KurioApp/crawler/cmd/crawler
# Test
.PHONY: test
test:
@echo "Run go test"
go test ./... -v -race -cover
.PHONY: unittest
unittest:
@echo "Run go test"
go test -short -v ./...
.PHONY: pubsub-down
pubsub-down:
@docker stop crawler_pubsub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment