Skip to content

Update mapstructure #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2024
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
2 changes: 1 addition & 1 deletion asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package stac
import (
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

type Asset struct {
Expand Down
2 changes: 1 addition & 1 deletion catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

type Catalog struct {
Expand Down
2 changes: 1 addition & 1 deletion catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"regexp"
"testing"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"github.com/planetlabs/go-stac"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
2 changes: 1 addition & 1 deletion collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

type Collection struct {
Expand Down
2 changes: 1 addition & 1 deletion extension.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"slices"
"sync"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

type Extension interface {
Expand Down
2 changes: 1 addition & 1 deletion extensions/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"github.com/planetlabs/go-stac"
)

Expand Down
2 changes: 1 addition & 1 deletion extensions/itemassets/itemassets.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
"github.com/planetlabs/go-stac"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ require (
github.com/dlclark/regexp2 v1.11.4
github.com/go-logr/logr v1.4.2
github.com/go-logr/zapr v1.3.0
github.com/go-viper/mapstructure/v2 v2.1.0
github.com/google/go-github/v51 v51.0.0
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/mitchellh/mapstructure v1.5.0
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1
github.com/schollz/progressbar/v3 v3.14.6
github.com/stretchr/testify v1.9.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w=
github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
Expand All @@ -42,8 +44,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ=
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
Expand Down
2 changes: 1 addition & 1 deletion item.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

var coreItemProperties = map[string]bool{
Expand Down
13 changes: 1 addition & 12 deletions link.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"regexp"

"github.com/mitchellh/mapstructure"
"github.com/go-viper/mapstructure/v2"
)

type Link struct {
Expand Down Expand Up @@ -41,12 +41,6 @@ func EncodeLinks(links []*Link) ([]map[string]any, []string, error) {
return nil, nil, err
}

// remove if https://github.com/mitchellh/mapstructure/issues/279 is fixed
delete(linkMap, "AdditionalFields")
for k, v := range link.AdditionalFields {
linkMap[k] = v
}

for _, extension := range link.Extensions {
extensionUris = append(extensionUris, extension.URI())
if err := extension.Encode(linkMap); err != nil {
Expand All @@ -68,11 +62,6 @@ func (link *Link) MarshalJSON() ([]byte, error) {
if err := mapstructure.Decode(link, &m); err != nil {
return nil, err
}
// remove if https://github.com/mitchellh/mapstructure/issues/279 is fixed
delete(m, "AdditionalFields")
for k, v := range link.AdditionalFields {
m[k] = v
}
return json.Marshal(m)
}

Expand Down