feat: Add TOML marshalling API

This commit is contained in:
2026-06-26 20:12:15 +02:00
parent 591d1f01d1
commit eac3a60e9e
8 changed files with 1519 additions and 6 deletions
+8 -1
View File
@@ -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)
}