Skip to content

Instantly share code, notes, and snippets.

@alexshd
Created May 6, 2024 08:56
Show Gist options
  • Save alexshd/57da205908e27980b54ce58149644546 to your computer and use it in GitHub Desktop.
Save alexshd/57da205908e27980b54ce58149644546 to your computer and use it in GitHub Desktop.
`Taskfile` base example for `go` project - test and rebuild on each saved change
# https://taskfile.dev
version: "3"
interval: 500ms
tasks:
default:
deps:
- test
test:
cmds:
- gotest -cover -race ./...
build:
cmds:
- task: tidy
- go build -o ./bin/app .
tidy:
cmds:
- go mod tidy
run:
desc: Watch and rebuild
watch: true
sources:
- "**/*.go"
generates:
- ./bin/app
deps:
- build
- test
cmds:
- ./bin/w17
silent: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment