feat: ignore tmp/ folder

This commit is contained in:
2025-05-30 21:23:02 +02:00
parent 51b7e6b3f9
commit ca3006c428
2 changed files with 2 additions and 46 deletions

2
.gitignore vendored
View File

@ -13,6 +13,8 @@
bin/* bin/*
tmp/
# Output of the go coverage tool, specifically when used with LiteIDE # Output of the go coverage tool, specifically when used with LiteIDE
*.out *.out

View File

@ -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