Skip to content

Commit

Permalink
Merge pull request #249 from kbolino/master
Browse files Browse the repository at this point in the history
Fix lint warning in GeoJSON unmarshaling
  • Loading branch information
twpayne authored Jul 29, 2024
2 parents 66e0b2e + 3730478 commit eb57e62
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions encoding/geojson/geojson.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,18 +493,10 @@ func Marshal(g geom.T, opts ...EncodeGeometryOption) ([]byte, error) {

// Unmarshal unmarshalls a []byte to an arbitrary geometry.
func Unmarshal(data []byte, g *geom.T) error {
if bytes.Equal(data, nullGeometry) {
*g = nil
return nil
}
// FIXME The following lint error is suppressed, but there is probably a genuine error here
//
//nolint:staticcheck
gg := &Geometry{}
if err := json.Unmarshal(data, gg); err != nil {
if err := json.Unmarshal(data, &gg); err != nil {
return err
}
//nolint:staticcheck
if gg == nil {
*g = nil
return nil
Expand Down

0 comments on commit eb57e62

Please sign in to comment.