Imported from jezek/funson (
AGENTS.md). Install upstream withnpx skills add jezek/funson. Copyright stays with the author.
Agent Guidelines
This project uses Go modules. When making changes:
- If you modify any Go files, format the changed code with
gofmt -w. - Run
go test ./...only when Go code is updated and ensure it succeeds. Include the test output in the PR description. - Keep commit messages concise.
- PR description should have a summary of changes and testing details.
Testing Conventions
- Tests should be table-driven. Declare a slice of test cases with a
namefield and execute each case usingt.Run. - Compare returned values and errors with
reflect.DeepEqualas done inglobalFunctions_test.go. - When a function returns both a result and an error, store expected values in
wantandwantErrfields, mirroringTestPathFuncAndIsPathFunc. - Use custom error types instead of
fmt.Errorfwhen equality checks are required. - Place tests in the
*_test.gofile that corresponds to the source file and keep them in the same order as the functions they verify.