This is an example of how to use the filtgen
.
We recommend that this section be run with xc
.
cd ../
go install -installsuffix filtgen
go install github.com/miyamo2/filtgen@latest
Set GOEXPERIMENT
to rangefunc
if Go version is 1.22.
GOVER=$(go mod graph)
if [[ $GOVER == *"go@1.22"* ]]; then
go env -w GOEXPERIMENT=rangefunc
fi
go generate ./...