feat: ignore tmp/ folder
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -13,6 +13,8 @@
|
||||
|
||||
bin/*
|
||||
|
||||
tmp/
|
||||
|
||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||
*.out
|
||||
|
||||
|
46
Makefile
46
Makefile
@ -1,46 +0,0 @@
|
||||
|
||||
# Project metadata
|
||||
APP_NAME := hspguard
|
||||
CMD_DIR := ./cmd/$(APP_NAME)
|
||||
BIN_DIR := ./bin
|
||||
BIN_PATH := $(BIN_DIR)/$(APP_NAME)
|
||||
PKG := ./...
|
||||
GO_FILES := $(shell find . -type f -name '*.go' -not -path "./vendor/*")
|
||||
|
||||
# Go tools
|
||||
GO := go
|
||||
GOLINT := golangci-lint
|
||||
GOFMT := gofmt
|
||||
GOTEST := go test
|
||||
|
||||
# Build flags
|
||||
LD_FLAGS := -s -w
|
||||
BUILD_TIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
|
||||
GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
|
||||
|
||||
.PHONY: all build clean fmt lint run
|
||||
|
||||
all: build
|
||||
|
||||
build:
|
||||
@mkdir -p $(BIN_DIR)
|
||||
$(GO) build -ldflags "-X main.buildTime=$(BUILD_TIME) -X main.commitHash=$(GIT_COMMIT) $(LD_FLAGS)" -o $(BIN_PATH) $(CMD_DIR)
|
||||
|
||||
run:
|
||||
$(GO) run $(CMD_DIR)
|
||||
|
||||
fmt:
|
||||
$(GOFMT) -s -w $(GO_FILES)
|
||||
|
||||
lint:
|
||||
$(GOLINT) run
|
||||
|
||||
test:
|
||||
$(GOTEST) -v $(PKG)
|
||||
|
||||
clean:
|
||||
@rm -rf $(BIN_DIR)
|
||||
|
||||
mod:
|
||||
$(GO) mod tidy
|
||||
|
||||
|
Reference in New Issue
Block a user