Installation
Requirements
Section titled “Requirements”- Go 1.26 or later
- An active Go module (
go.mod)
Install
Section titled “Install”Run this in your project directory:
go get github.com/LarsArtmann/gogenfilter/v3@latestQuick Usage
Section titled “Quick Usage”package main
import ( "fmt"
"github.com/LarsArtmann/gogenfilter/v3")
func main() { opts, err := gogenfilter.WithFilterOptions(gogenfilter.FilterAll) if err != nil { panic(err) } filter, err := gogenfilter.NewFilter(opts) if err != nil { panic(err) }
filtered, err := filter.Filter("user.sql.go") if err != nil { panic(err) } if filtered { fmt.Printf("Filtered: %s\n", "user.sql.go") }}Import Options
Section titled “Import Options”import "github.com/LarsArtmann/gogenfilter/v3"gogenfilter re-exports MatchPattern for convenience, so you don’t need a separate doublestar import.
Verify Installation
Section titled “Verify Installation”go list -m github.com/LarsArtmann/gogenfilter/v3Next Steps
Section titled “Next Steps”- Follow the Quick Start for complete examples
- Learn about Filter Options to customize detection
- See Supported Generators for the full list