mirror of
https://github.com/spf13/viper
synced 2025-05-12 07:07:21 +00:00
upgrade gopkg.in/yaml.v2 to gopkg.in/yaml.v3
This commit is contained in:
parent
04d3a0cb02
commit
8317acfc14
5 changed files with 58 additions and 56 deletions
|
@ -794,7 +794,7 @@ You can use your favorite format's marshaller with the config returned by `AllSe
|
|||
|
||||
```go
|
||||
import (
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
yaml "gopkg.in/yaml.v3"
|
||||
// ...
|
||||
)
|
||||
|
||||
|
|
4
go.mod
4
go.mod
|
@ -16,7 +16,7 @@ require (
|
|||
github.com/stretchr/testify v1.7.0
|
||||
github.com/subosito/gotenv v1.2.0
|
||||
gopkg.in/ini.v1 v1.66.2
|
||||
gopkg.in/yaml.v2 v2.4.0
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
)
|
||||
|
||||
require (
|
||||
|
@ -65,5 +65,5 @@ require (
|
|||
google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect
|
||||
google.golang.org/grpc v1.43.0 // indirect
|
||||
google.golang.org/protobuf v1.27.1 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package yaml
|
||||
|
||||
import "gopkg.in/yaml.v2"
|
||||
import (
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
// Codec implements the encoding.Encoder and encoding.Decoder interfaces for YAML encoding.
|
||||
type Codec struct{}
|
||||
|
|
|
@ -54,11 +54,11 @@ var decoded = map[string]interface{}{
|
|||
"item2",
|
||||
"item3",
|
||||
},
|
||||
"map": map[interface{}]interface{}{
|
||||
"map": map[string]interface{}{
|
||||
"key": "value",
|
||||
},
|
||||
"nested_map": map[interface{}]interface{}{
|
||||
"map": map[interface{}]interface{}{
|
||||
"nested_map": map[string]interface{}{
|
||||
"map": map[string]interface{}{
|
||||
"key": "value",
|
||||
"list": []interface{}{
|
||||
"item1",
|
||||
|
|
Loading…
Add table
Reference in a new issue