From 898bc844bc4bbdbb2cc85642be2c3da3885664ea Mon Sep 17 00:00:00 2001 From: Fuwn Date: Fri, 30 Jan 2026 20:39:13 -0800 Subject: feat: Add Taskfile for Go --- Go.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Go.yaml diff --git a/Go.yaml b/Go.yaml new file mode 100644 index 0000000..f0204ed --- /dev/null +++ b/Go.yaml @@ -0,0 +1,54 @@ +version: "3" + +tasks: + default: + desc: Build the application + cmds: + - task: build + + build: + desc: Build the binary with optimisations + cmds: + - go build -ldflags="-s -w" -o {{.BINARY}} . + sources: + - ./**/*.go + generates: + - ./{{.BINARY}} + + run: + desc: Build and run the application + deps: [build] + cmds: + - ./{{.BINARY}} + + install: + desc: Install the binary to GOPATH/bin + deps: [build] + cmds: + - cp {{.BINARY}} ${GOPATH:-~/go}/bin/{{.BINARY}} + + clean: + desc: Remove build artifacts + cmds: + - rm -f {{.BINARY}} + - go clean + + test: + desc: Run tests + cmds: + - go test ./... + + fmt: + desc: Format code + cmds: + - iku -w . || go fmt ./... + + lint: + desc: Run linter + cmds: + - golangci-lint run + + dev: + desc: Build and run in development mode + cmds: + - go run . -- cgit v1.2.3