Skip to content

Commit 831a622

Browse files
authored
Merge pull request #703 from peterstace/disable_ireturn
Disable ireturn linter
2 parents 1e24be9 + 409c9c7 commit 831a622

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

.golangci.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ linters-settings:
4040
- (*github.com/peterstace/simplefeatures/rtree.RTree).RangeSearch
4141
- (*github.com/peterstace/simplefeatures/rtree.RTree).PrioritySearch
4242

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

4748
enable:
@@ -81,7 +82,6 @@ linters:
8182
- importas
8283
- ineffassign
8384
- intrange
84-
- ireturn
8585
- loggercheck
8686
- makezero
8787
- mirror
@@ -145,6 +145,7 @@ linters:
145145
- gomnd
146146
- inamedparam
147147
- interfacebloat
148+
- ireturn
148149
- lll
149150
- maintidx
150151
- nestif

geom/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func arbitraryControlPoint(g Geometry) Point {
141141
}
142142
}
143143

144-
func catch[T any](fn func() (T, error)) (result T, err error) { //nolint:ireturn
144+
func catch[T any](fn func() (T, error)) (result T, err error) {
145145
// In Go 1.21+, panic(nil) causes recover() to return a *runtime.PanicNilError
146146
// rather than nil. In earlier versions, recover() returns nil for panic(nil),
147147
// making it indistinguishable from "no panic". We emulate the Go 1.21+ behavior

internal/jtsport/java/polymorphic.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ type Polymorphic interface {
1212

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

0 commit comments

Comments
 (0)