Skip to content

Commit

Permalink
Merge pull request #253 from twpayne/misc-fixes
Browse files Browse the repository at this point in the history
Miscellaneous fixes
  • Loading branch information
twpayne committed Aug 12, 2024
2 parents 91fb2e1 + 0314fae commit 8e46749
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 42 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ on:
push:
env:
GOFUMPT_VERSION: 0.6.0
GOLANGCI_LINT_VERSION: 1.56.2
GOTOOLCHAIN: local
GOLANGCI_LINT_VERSION: 1.59.1
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
cache: true
go-version-file: go.mod
Expand All @@ -29,8 +30,8 @@ jobs:
darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
cache: true
go-version-file: go.mod
Expand All @@ -41,8 +42,8 @@ jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
cache: true
go-version-file: go.mod
Expand All @@ -53,12 +54,12 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32
with:
cache: true
go-version-file: go.mod
- uses: golangci/golangci-lint-action@3cfe3a4abbb849e10058ce4af15d205b6da42804
- uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86
with:
version: v${{ env.GOLANGCI_LINT_VERSION }}
- name: format
Expand Down
9 changes: 5 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ linters:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- containedctx
- contextcheck
- decorder
- dogsled
- dupl
- dupword
- durationcheck
- err113
- errcheck
- errchkjson
- errorlint
- execinquery
- exportloopref
- fatcontext
- forbidigo
- forcetypeassert
- gci
Expand All @@ -25,7 +27,6 @@ linters:
- gochecksumtype
- gocritic
- godot
- goerr113
- gofmt
- gofumpt
- goimports
Expand Down Expand Up @@ -78,6 +79,7 @@ linters:
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
disable:
Expand All @@ -104,7 +106,6 @@ linters:
- testpackage
- testpackage
- varnamelen
- wastedassign # https://github.com/golangci/golangci-lint/issues/2649
- wrapcheck
- wsl

Expand Down Expand Up @@ -149,7 +150,7 @@ issues:
- godot
path: "^xyz/"
- linters:
- goerr113
- err113
text: "do not define dynamic errors, use wrapped static errors instead"
- linters:
- forbidigo
Expand Down
14 changes: 7 additions & 7 deletions encoding/ewkb/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func (p *Point) Valid() bool {
// Value returns the EWKB encoding of p.
func (p *Point) Value() (driver.Value, error) {
if p.Point == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(p.Point)
}
Expand Down Expand Up @@ -125,7 +125,7 @@ func (ls *LineString) Valid() bool {
// Value returns the EWKB encoding of ls.
func (ls *LineString) Value() (driver.Value, error) {
if ls.LineString == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(ls.LineString)
}
Expand Down Expand Up @@ -160,7 +160,7 @@ func (p *Polygon) Valid() bool {
// Value returns the EWKB encoding of p.
func (p *Polygon) Value() (driver.Value, error) {
if p.Polygon == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(p.Polygon)
}
Expand Down Expand Up @@ -195,7 +195,7 @@ func (mp *MultiPoint) Valid() bool {
// Value returns the EWKB encoding of mp.
func (mp *MultiPoint) Value() (driver.Value, error) {
if mp.MultiPoint == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(mp.MultiPoint)
}
Expand Down Expand Up @@ -230,7 +230,7 @@ func (mls *MultiLineString) Valid() bool {
// Value returns the EWKB encoding of mls.
func (mls *MultiLineString) Value() (driver.Value, error) {
if mls.MultiLineString == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(mls.MultiLineString)
}
Expand Down Expand Up @@ -265,7 +265,7 @@ func (mp *MultiPolygon) Valid() bool {
// Value returns the EWKB encoding of mp.
func (mp *MultiPolygon) Value() (driver.Value, error) {
if mp.MultiPolygon == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(mp.MultiPolygon)
}
Expand Down Expand Up @@ -300,7 +300,7 @@ func (gc *GeometryCollection) Valid() bool {
// Value returns the EWKB encoding of gc.
func (gc *GeometryCollection) Value() (driver.Value, error) {
if gc.GeometryCollection == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
return value(gc.GeometryCollection)
}
Expand Down
2 changes: 1 addition & 1 deletion encoding/geojson/geojson.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func guessLayout3(coords3 [][][]geom.Coord) (geom.Layout, error) {
// Decode decodes g to a geometry.
func (g *Geometry) Decode() (geom.T, error) {
if g == nil {
return nil, nil
return nil, nil //nolint:nilnil
}
switch g.Type {
case "Point":
Expand Down
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ module github.com/twpayne/go-geom

go 1.21

toolchain go1.22.1

require (
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/alecthomas/assert/v2 v2.6.0
github.com/alecthomas/assert/v2 v2.10.0
github.com/lib/pq v1.10.9
github.com/testcontainers/testcontainers-go v0.29.1
github.com/testcontainers/testcontainers-go/modules/postgres v0.29.1
github.com/twpayne/go-kml/v3 v3.1.0
github.com/twpayne/go-kml/v3 v3.1.1
)

require (
Expand Down
24 changes: 8 additions & 16 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/Microsoft/hcsshim v0.12.0 h1:rbICA+XZFwrBef2Odk++0LjFvClNCJGRK+fsrP254Ts=
github.com/Microsoft/hcsshim v0.12.0/go.mod h1:RZV12pcHCXQ42XnlQ3pz6FZfmrC1C+R4gaOHhRNML1g=
github.com/alecthomas/assert v1.0.0 h1:3XmGh/PSuLzDbK3W2gUbRXwgW5lqPkuqvRgeQ30FI5o=
github.com/alecthomas/assert v1.0.0/go.mod h1:va/d2JC+M7F6s+80kl/R3G7FUiW6JzUO+hPhLyJ36ZY=
github.com/alecthomas/assert/v2 v2.6.0 h1:o3WJwILtexrEUk3cUVal3oiQY2tfgr/FHWiz/v2n4FU=
github.com/alecthomas/assert/v2 v2.6.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/colour v0.1.0 h1:nOE9rJm6dsZ66RGWYSFrXw461ZIt9A6+nHgL7FRrDUk=
github.com/alecthomas/colour v0.1.0/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0=
github.com/alecthomas/assert/v2 v2.10.0 h1:jjRCHsj6hBJhkmhznrCzoNpbA3zqy0fYiUcYZP/GkPY=
github.com/alecthomas/assert/v2 v2.10.0/go.mod h1:Bze95FyfUr7x34QZrjL+XP+0qgp/zg8yS+TtBj1WA3k=
github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc=
github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
Expand Down Expand Up @@ -81,8 +77,6 @@ github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a h1:3Bm7EwfUQUvhNe
github.com/lufia/plan9stats v0.0.0-20240226150601-1dcf7310316a/go.mod h1:ilwx/Dta8jXAgpFYFvSWEMwxmbWXyiUHkd5FwyKhb5k=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
Expand All @@ -106,8 +100,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 h1:o4JXh1EVt9k/+g42oCprj/FisM4qX9L3sZB3upGN2ZU=
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55/go.mod h1:OmDBASR4679mdNQnz2pUhc2G8CO2JrUAVFDRBDP/hJE=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shirou/gopsutil/v3 v3.24.2 h1:kcR0erMbLg5/3LcInpw0X/rrPSqq4CDPyI6A6ZRC18Y=
github.com/shirou/gopsutil/v3 v3.24.2/go.mod h1:tSg/594BcA+8UdQU2XcW803GWYgdtauFFPgJCJKZlVk=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
Expand Down Expand Up @@ -135,8 +127,8 @@ github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5I
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/tklauser/numcpus v0.7.0 h1:yjuerZP127QG9m5Zh/mSO4wqurYil27tHrqwRoRjpr4=
github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY=
github.com/twpayne/go-kml/v3 v3.1.0 h1:sCTIhB5VtyhOyiiGAaGZG7t/C7yFleNn8jmgWfhwtGQ=
github.com/twpayne/go-kml/v3 v3.1.0/go.mod h1:MtFRxfOSa60jCuC/mZNa2c9WkvOxk3t/h7o5lrsi1h4=
github.com/twpayne/go-kml/v3 v3.1.1 h1:Fq2k4nKa2dIipJt0r5gwLEYcJA/7WeqKW2KTkrRXWOs=
github.com/twpayne/go-kml/v3 v3.1.1/go.mod h1:7VT0jsr6fzn5CPZ5e4OB93vhgf3fZcwflK7ydbXFVos=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
Expand Down Expand Up @@ -172,8 +164,8 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys=
golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -194,8 +186,8 @@ golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/time v0.3.0 h1:rg5rLMjNzMS1RkNLzCG38eapWhnYLFYXDXj2gOlr8j4=
golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Expand Down

0 comments on commit 8e46749

Please sign in to comment.