Skip to content

Commit

Permalink
docs: Improve marshal section (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
bersace authored Aug 29, 2024
1 parent c53f381 commit ec1d17c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func main() {
```

### Unmarshalling and marshalling
`Parser`s can be used to unmarshal and scan the values in a Koanf instance into a struct based on the field tags, and to marshal a Koanf instance back into serialized bytes, for example, back to JSON or YAML, to write back to files.
`Parser`s can be used to unmarshal and scan the values in a Koanf instance into a struct based on the field tags, and to marshal a Koanf instance back into serialized bytes, for example to JSON or YAML files

```go
package main
Expand Down Expand Up @@ -372,7 +372,7 @@ func main() {
fmt.Println(out)

// Marshal the instance back to JSON.
// The paser instance can be anything, eg: json.Paser(), yaml.Parser() etc.
// The parser instance can be anything, eg: json.Parser(), yaml.Parser() etc.
b, _ := k.Marshal(parser)
fmt.Println(string(b))
}
Expand Down

0 comments on commit ec1d17c

Please sign in to comment.