Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -130,12 +130,12 @@ func Run(stdout, stderr io.Writer) int {
|
||||
}
|
||||
fmt.Fprintf(stdout, "\n--- marshal (group by kind, default) ---\n%s", out)
|
||||
|
||||
out2, err := interpres.NewEncoder().GroupByKind(false).Marshal(cfg)
|
||||
out2, err := interpres.NewEncoder().Layout(interpres.LayoutKindDeclaration).Marshal(cfg)
|
||||
if err != nil {
|
||||
fmt.Fprintln(stderr, "marshal:", err)
|
||||
return 1
|
||||
}
|
||||
fmt.Fprintf(stdout, "\n--- marshal (GroupByKind=false) ---\n%s", out2)
|
||||
fmt.Fprintf(stdout, "\n--- marshal (LayoutKindDeclaration) ---\n%s", out2)
|
||||
|
||||
// Demonstrate Unmarshaler-style mutation: re-decode the second output to
|
||||
// prove it round-trips back into the same Go value.
|
||||
|
||||
Reference in New Issue
Block a user