gohawk

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 29, 2026 License: Apache-2.0, MIT Imports: 1 Imported by: 0

README

gohawk

CI Coverage

gohawk is a focused set of static analyzers for Go, designed to run alongside go vet, Staticcheck, and go-critic. It covers gaps around ownership, lifecycle, concurrency, API contracts, and path-aware policy checks.

It draws inspiration from go-critic, but is deliberately more focused on correctness and reliability, with fewer opinionated style checks.

Read the documentation

Quick Start

# Install.
go install github.com/kojah/gohawk@latest

# Run the default profile.
gohawk ./...

# See every analyzer, its profile, and its group.
gohawk list

# Inspect an analyzer or one of its checks.
gohawk doc contextpolicy
gohawk doc contextpolicy/nil-context

# Use it with go vet.
go vet -vettool="$(command -v gohawk)" ./...

# Preview safe fixes, then apply them.
gohawk -fix -diff ./...
gohawk -fix ./...

# Run selected opt-in checks, or exclude one from the defaults.
gohawk -enable=wirepolicy,globalstate ./...
gohawk -disable=oncepolicy ./...

# Run complete analyzer groups, including their opt-in checks.
gohawk -enable-groups=ownership,testing ./...

# Remove groups from the default profile or from -enable-all.
gohawk -disable-groups=testing ./...

# Run every analyzer, including opt-in checks.
gohawk -enable-all ./...

Contributing

Contributions are welcome. See How to contribute for the development workflow, analyzer requirements, and verification steps.

Sponsorship

If gohawk is useful to you or your organization, consider sponsoring its continued development. Sponsorship helps fund maintenance, new analyzers, and improvements to the documentation and developer experience. To discuss sponsorship, get in touch with @kojah.

License

Licensed under either the Apache License, Version 2.0 or the MIT License, at your option.

Documentation

Overview

Command gohawk runs the gohawk static analyzers.

Directories

Path Synopsis
Package analysisutil contains unsupported implementation details shared with Veritas.
Package analysisutil contains unsupported implementation details shared with Veritas.
Package analyzers provides a curated collection of static analyzers for Go.
Package analyzers provides a curated collection of static analyzers for Go.
Package general provides framework-neutral Go policy analyzers.
Package general provides framework-neutral Go policy analyzers.
internal
cli
Package cli implements the gohawk command.
Package cli implements the gohawk command.
cmd/gendocs command
Command gendocs synchronizes analyzer metadata with the documentation site.
Command gendocs synchronizes analyzer metadata with the documentation site.
docexamples
Package docexamples runs analyzers against the living examples used by the documentation site.
Package docexamples runs analyzers against the living examples used by the documentation site.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL