Refactor the golangci-lint configuration to use the latest version and
update GitHub Actions workflows. Key changes include:
- Update golangci-lint to v2.6
- Update GitHub Actions to use latest checkout and setup-go actions
- Update Go versions in test matrix
- Remove deprecated cache steps
- Update Makefile golangci-lint tool version
- Minor documentation formatting improvements
When validating non-struct types, we should not try and convert field
values in errors, because there is no struct field to lookup. Hence this
fix stops a panic from happening.
It is up to the Validate() method itself to provide the correct and
final field value when validating non-struct types.
This is a bare-bones implementation of a basic validation package based
around a very simply Validatable interface:
type Validatable interface {
Validate() error
}
The goal is to keep things as simple as possible, while also giving as
much control as possible over how validation logic is performed.