feat: Add TOML marshalling API
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// Command basic demonstrates decoding a TOML document with interpres.
|
||||
// Command basic demonstrates decoding and encoding a TOML document with
|
||||
// interpres.
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -48,4 +49,10 @@ func main() {
|
||||
for _, u := range cfg.Users {
|
||||
fmt.Printf("user: %-6s admin=%t\n", u.Name, u.Admin)
|
||||
}
|
||||
|
||||
out, err := interpres.Marshal(cfg)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
fmt.Printf("\n--- marshal ---\n%s", out)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user