Skip to content

Commit

Permalink
Run golangci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
carlohamalainen committed Feb 27, 2024
1 parent d33500b commit 2590662
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mapstructure_examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,15 +300,15 @@ func ExampleDecode_decodeHookFunc() {
}

type Person struct {
Name string
Name string
Location PersonLocation
}

// Example of parsing messy input: here we have latitude, longitude squashed into
// a single string field. We write a custom DecodeHookFunc to parse the '#' separated
// values into a PersonLocation struct.
input := map[string]interface{}{
"name": "Mitchell",
"name": "Mitchell",
"location": "-35.2809#149.1300",
}

Expand Down Expand Up @@ -340,9 +340,9 @@ func ExampleDecode_decodeHookFunc() {
var result Person

decoder, errDecoder := NewDecoder(&DecoderConfig{
Metadata: nil,
Metadata: nil,
DecodeHook: toPersonLocationHookFunc(), // Here, use ComposeDecodeHookFunc to run multiple hooks.
Result: &result,
Result: &result,
})
if errDecoder != nil {
panic(errDecoder)
Expand Down

0 comments on commit 2590662

Please sign in to comment.