Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ linters-settings:
- (*github.com/peterstace/simplefeatures/rtree.RTree).RangeSearch
- (*github.com/peterstace/simplefeatures/rtree.RTree).PrioritySearch

# NOTE: every linter supported by golangci-lint is either explicitly included
# or excluded.
# NOTE: every linter supported by golangci-lint is either explicitly enabled
# or disabled. When adding or removing a linter, move it between the two
# sections rather than just deleting it.
linters:

enable:
Expand Down Expand Up @@ -81,7 +82,6 @@ linters:
- importas
- ineffassign
- intrange
- ireturn
- loggercheck
- makezero
- mirror
Expand Down Expand Up @@ -145,6 +145,7 @@ linters:
- gomnd
- inamedparam
- interfacebloat
- ireturn
- lll
- maintidx
- nestif
Expand Down
2 changes: 1 addition & 1 deletion geom/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func arbitraryControlPoint(g Geometry) Point {
}
}

func catch[T any](fn func() (T, error)) (result T, err error) { //nolint:ireturn
func catch[T any](fn func() (T, error)) (result T, err error) {
// In Go 1.21+, panic(nil) causes recover() to return a *runtime.PanicNilError
// rather than nil. In earlier versions, recover() returns nil for panic(nil),
// making it indistinguishable from "no panic". We emulate the Go 1.21+ behavior
Expand Down
4 changes: 2 additions & 2 deletions internal/jtsport/java/polymorphic.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Polymorphic interface {

// GetLeaf walks the child chain to find the leaf (concrete) type. This is used
// by dispatchers to find the most-derived implementation of a method.
func GetLeaf(obj Polymorphic) Polymorphic { //nolint:ireturn
func GetLeaf(obj Polymorphic) Polymorphic {
for {
child := obj.GetChild()
if child == nil {
Expand Down Expand Up @@ -77,7 +77,7 @@ func InstanceOf[T any](obj Polymorphic) bool {
//
// Panics with a descriptive message if obj cannot be cast to T (equivalent to
// Java's ClassCastException).
func Cast[T Polymorphic](obj Polymorphic) T { //nolint:ireturn
func Cast[T Polymorphic](obj Polymorphic) T {
var zero T
if obj == nil {
panic(fmt.Sprintf("cannot cast nil to %T", zero))
Expand Down