Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
12 views1 page

Task File

This document outlines a Taskfile configuration for managing tasks in a Go project. It includes tasks for linting, testing, formatting, profiling, and generating a JSON schema. Each task specifies its description and the command to be executed, utilizing tools like golangci-lint and go tool pprof.

Uploaded by

hatr626
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Task File

This document outlines a Taskfile configuration for managing tasks in a Go project. It includes tasks for linting, testing, formatting, profiling, and generating a JSON schema. Each task specifies its description and the command to be executed, utilizing tools like golangci-lint and go tool pprof.

Uploaded by

hatr626
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

# https://taskfile.

dev

version: "3"

tasks:
lint:
desc: Run base linters
cmds:
- golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m

lint-fix:
desc: Run base linters and fix issues
cmds:
- golangci-lint run --path-mode=abs --config=".golangci.yml" --timeout=5m --
fix

test:
desc: Run tests
cmds:
- go test ./... {{.CLI_ARGS}}

fmt:
desc: Run gofumpt
cmds:
- gofumpt -w .

dev:
desc: Run with profiling enabled
env:
CRUSH_PROFILE: true
cmds:
- go run .

profile:cpu:
desc: 10s CPU profile
cmds:
- go tool pprof -http :6061 'http://localhost:6060/debug/pprof/profile?
seconds=10'

profile:heap:
desc: Heap profile
cmds:
- go tool pprof -http :6061 'http://localhost:6060/debug/pprof/heap'

profile:allocs:
desc: Allocations profile
cmds:
- go tool pprof -http :6061 'http://localhost:6060/debug/pprof/allocs'

schema:
desc: Generate JSON schema for configuration
cmds:
- go run main.go schema > schema.json
- echo "Generated schema.json"

You might also like