go generate ./...Run go:generate directives in the current module. Useful in Go CLI workflows.
go tool, go generate, code generation, formatting helpers, analysis tools, and practical developer automation with the Go CLI.
go generate commands and patterns for the Go command.
go generate ./...Run go:generate directives in the current module. Useful in Go CLI workflows.
go generate -run "stringer|mockgen" ./...Only run generators whose command matches a regexp. Useful in Go CLI workflows.
go generate -x ./...Echo each generate command before running it. Useful in Go CLI workflows.
go tool commands and patterns for the Go command.
go tool cover -helpShow help for a specific Go tool. Useful in Go CLI workflows.
go tool pprof cpu.profOpen a CPU or memory profile with pprof. Useful in Go CLI workflows.
go tool trace trace.outOpen an execution trace for visualization. Useful in Go CLI workflows.
go tool asm -helpShow available assembler flags. Useful in Go CLI workflows.
Formatting and source transforms commands and patterns for the Go command.
gofmt -w main.goFormat a file and write changes. Useful in Go CLI workflows.
gofmt -d .Print the file if formatting would change it. Useful in Go CLI workflows.
go fix ./...Update packages using automated code fixers. Useful in Go CLI workflows.
Analysis and inspection commands and patterns for the Go command.
go test -run=^$ ./...Build tests without running them. Useful in Go CLI workflows.
go list -deps ./...List all packages including dependencies. Useful in Go CLI workflows.
go list -f "{{.ImportPath}} {{.Dir}}" ./...Print custom package metadata fields via template. Useful in Go CLI workflows.