forbidigo is a linter for Go code that checks source files for identifiers and expressions you want to forbid.
It is designed to help stop debugging calls and other temporary or undesirable usages from being left in a codebase, and it can be used either through golangci-lint or as a standalone command-line tool.
This is free and open source software.
Key Features
- Matches forbidden identifiers and expressions using regular expression patterns.
- Uses a default rule that catches
fmt.Print,print, andprintlnstatements. - Supports type-aware analysis with the
analyze_typesoption to resolve aliases and referenced types. - Accepts richer JSON or YAML pattern definitions with custom messages and package path matching.
- Excludes Godoc examples by default and can be configured to include or exclude test files.
- Can return a non-zero exit status when issues are found, which makes it suitable for CI workflows.
Website: github.com/ashanbrown/forbidigo
Support:
Developer: Andrew Shannon Brown
License: Apache License 2.0
forbidigo is written in Go. Learn Go with our recommended free books and free tutorials.
Related Software
| Go Linters | |
|---|---|
| revive | Designed as a drop-in replacement for golint |
| golangci-lint | Fast Go linters runner |
| gosec | Security scanner for Go projects |
| Staticcheck | Advanced Go linter |
| go-critic | Opinionated Go source code linter |
| Vet | Examines Go source code and reports suspicious constructs |
| gofumpt | Stricter gofmt |
| gofmt | Formats Go programs |
| goconst | Find repeated Go literals that could be replaced with constants |
| go-ruleguard | Analysis-based Go linter that runs dynamically loaded rules |
| sloglint | Enforce consistent structured logging conventions in Go |
| forbidigo | Go linter for forbidding identifiers |
| godot | Keep source code comments consistent |
| Godoc-Lint | Enforce consistent documentation comments in Go code |
| exhaustive | Check Go switch statements for missing enum cases |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.