Skip to content

Commit

Permalink
Update golangci-lint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
twpayne committed Mar 12, 2024
1 parent 8d0ca94 commit 478bce6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
env:
GOFUMPT_VERSION: 0.3.1
GOLANGCI_LINT_VERSION: 1.49.0
GOLANGCI_LINT_VERSION: 1.56.2
jobs:
linux:
runs-on: ubuntu-latest
Expand Down
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ linters:
enable:
- asciicheck
- bodyclose
- depguard
- dogsled
- dupl
- durationcheck
Expand Down Expand Up @@ -37,6 +36,8 @@ linters:
- predeclared
- promlinter
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagliatelle
Expand All @@ -46,9 +47,11 @@ linters:
- unconvert
- unparam
- unused
- wastedassign
- whitespace
disable:
- cyclop
- depguard
- exhaustive
- exhaustivestruct
- funlen
Expand All @@ -63,10 +66,7 @@ linters:
- nestif
- nlreturn
- paralleltest
- rowserrcheck # https://github.com/golangci/golangci-lint/issues/2649
- sqlclosecheck # https://github.com/golangci/golangci-lint/issues/2649
- testpackage
- wastedassign # https://github.com/golangci/golangci-lint/issues/2649
- wrapcheck
- wsl

Expand Down
2 changes: 1 addition & 1 deletion encoding/geojson/geojson.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func EncodeGeometryWithBBox() EncodeGeometryOption {
// EncodeGeometryWithCRS adds the crs field to the Geometry GeoJSON encoding.
func EncodeGeometryWithCRS(crs *CRS) EncodeGeometryOption {
return EncodeGeometryOption{
onGeometryHandler: func(g *Geometry, t geom.T, opts ...EncodeGeometryOption) error {
onGeometryHandler: func(g *Geometry, _ geom.T, _ ...EncodeGeometryOption) error {
var err error
g.CRS = crs
return err
Expand Down
1 change: 1 addition & 0 deletions encoding/wkb/sql_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ func Example_value_different_shapes() {
}

for _, s := range shapes {
s := s
result, err := db.Exec(`INSERT INTO objects (name, location) VALUES (?, ?);`, s.Name, &s.Geom)
if err != nil {
log.Fatal(err)
Expand Down
6 changes: 2 additions & 4 deletions xy/internal/robustdeterminate/robust_determinate.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ func SignOfDet2x2(x1, y1, x2, y2 float64) Sign {
*/
if 0.0 < y1 {
if 0.0 < y2 {
if y1 <= y2 {
} else {
if y1 > y2 {
sign = Negative
swap = x1
x1 = x2
Expand Down Expand Up @@ -145,8 +144,7 @@ func SignOfDet2x2(x1, y1, x2, y2 float64) Sign {
*/
if 0.0 < x1 {
if 0.0 < x2 {
if x1 <= x2 {
} else {
if x1 > x2 {
return sign
}
} else {
Expand Down

0 comments on commit 478bce6

Please sign in to comment.