Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ version: "3"
env:
TARGET: gostarter #Change this to suit
APPPATH: ./cmd/gostarter/main.go #Change this to suit
ENV: dev

dotenv: ["./envs/{{.ENV}}.env"]

tasks:
## version - get the Go version
version:
desc: "Get the Go version."
cmds:
- go version

## release - Builds the project in preparation for (local)release
release:
desc: "Builds the project in preparation for (local)release."
deps: [vet, lint, seccheck]
cmds:
- go generate $APPPATH
Expand All @@ -45,32 +50,45 @@ tasks:

## goreleaser - Builds the project in preparation for release
goreleaser:
desc: "Builds a cross platform release using goreleaser."
cmds:
- goreleaser release --snapshot --clean

## build - Builds the project in preparation for debug
build:
desc: "Builds the project in preparation for debug."
deps: [clean]
cmds:
- go build -o bin/$TARGET $APPPATH
- file bin/$TARGET

## run - builds and runs the program on the target platform
run:
desc: "Builds and runs the program on the target platform."
cmds:
- go run $APPPATH

## debug - builds and runs the program on the target platform
debug:
desc: "Runs a debug version of the application with input parameters from the environment file."
cmds:
- go run $APPPATH --param1 $VALUE1

## watch - use air server for hot reloading
watch:
desc: "Use air server for hot reloading."
cmds:
- air

## docs - updates the swagger docs
docs:
desc: "Updates the swagger docs - For APIs."
cmds:
- swag init

## clean - Remove the old builds and any debug information
clean:
desc: "Removes the old builds and any debug information from the source tree."
cmds:
- go clean -cache
- go clean
Expand All @@ -79,39 +97,46 @@ tasks:

## test - executes unit tests
test:
desc: "Executes unit tests."
cmds:
- go test -v ./test/...

## deps - fetches any external dependencies and updates
deps:
desc: "Fetches any external dependencies and updates."
cmds:
- go mod tidy
- go mod download
- go get -u ./...

## vet - Vet examines Go source code and reports suspicious constructs
vet:
desc: "Vet examines Go source code and reports suspicious constructs."
cmds:
- go vet ./...

## staticcheck - Runs static code analyzer staticcheck - currently broken
## staticcheck - Runs static code analyzer staticcheck
staticcheck:
desc: "Runs static code analyzer staticcheck."å
cmds:
- staticcheck ./...

## seccheck - Code vulnerability check
seccheck:
desc: "Code vulnerability scanner check."
cmds:
- govulncheck ./...

## lint - format code and tidy modules
lint:
desc: "Lint, format and tidy code."
cmds:
- go fmt ./...
- go mod tidy -v
- golangci-lint run ./...

## generate - update build version
generate:
desc: "update binary build version using gogenerate."
cmds:
- go generate $APPPATH
2 changes: 1 addition & 1 deletion deployments/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.21.0-bullseye
FROM golang:1.22.5-bullseye

WORKDIR /cmd/gostarter

Expand Down