diff options
author | Charlie Stanton <charlie@shtanton.xyz> | 2023-03-15 20:11:10 +0000 |
---|---|---|
committer | Charlie Stanton <charlie@shtanton.xyz> | 2023-03-15 20:11:10 +0000 |
commit | 61a32b2d3266e9c3661aef6842ba4a1913da2df0 (patch) | |
tree | 47e4f8793e17d0c70430992982ded03be59484bf /walk/walk.go | |
parent | 6f107b7a0ccfbcd3e2ec05d91c98877d9b2e0fc7 (diff) | |
download | stred-go-61a32b2d3266e9c3661aef6842ba4a1913da2df0.tar |
Fixes strings being wrapped in quotes twice when outputting
Diffstat (limited to 'walk/walk.go')
-rw-r--r-- | walk/walk.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/walk/walk.go b/walk/walk.go index d71ae44..33e5554 100644 --- a/walk/walk.go +++ b/walk/walk.go @@ -312,7 +312,7 @@ func jsonOutValue(in *WalkItemStream, indent int, doIndent bool) WalkValue { if !hasToken { panic("Missing JSON token in output") } - switch token.Value.(type) { + switch v := token.Value.(type) { case ValueNull: if doIndent { printIndent(indent) @@ -339,7 +339,7 @@ func jsonOutValue(in *WalkItemStream, indent int, doIndent bool) WalkValue { if doIndent { printIndent(indent) } - fmt.Printf("%q", token.Value) + fmt.Printf("%q", string(v)) return nil case TerminalValue: switch token.Value.(TerminalValue) { |