<- Back to shtanton's homepage
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Stanton <charlie@shtanton.xyz>2023-03-15 20:11:10 +0000
committerCharlie Stanton <charlie@shtanton.xyz>2023-03-15 20:11:10 +0000
commit61a32b2d3266e9c3661aef6842ba4a1913da2df0 (patch)
tree47e4f8793e17d0c70430992982ded03be59484bf
parent6f107b7a0ccfbcd3e2ec05d91c98877d9b2e0fc7 (diff)
downloadstred-go-61a32b2d3266e9c3661aef6842ba4a1913da2df0.tar
Fixes strings being wrapped in quotes twice when outputting
-rw-r--r--walk/walk.go4
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) {