Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ func (d *decoder) scalar(n *Node, out reflect.Value) bool {
if err != nil {
failf("!!binary value contains invalid base64 data")
}
resolved = string(data)
resolved = data
}
}
if resolved == nil {
Expand Down
6 changes: 3 additions & 3 deletions decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,13 @@ var unmarshalTests = []struct {
// Binary data.
{
"a: !!binary gIGC\n",
map[string]string{"a": "\x80\x81\x82"},
map[string][]byte{"a": []byte{0x80, 0x81, 0x82}},
}, {
"a: !!binary |\n " + strings.Repeat("kJCQ", 17) + "kJ\n CQ\n",
map[string]string{"a": strings.Repeat("\x90", 54)},
map[string][]byte{"a": bytes.Repeat([]byte{0x90}, 54)},
}, {
"a: !!binary |\n " + strings.Repeat("A", 70) + "\n ==\n",
map[string]string{"a": strings.Repeat("\x00", 52)},
map[string][]byte{"a": bytes.Repeat([]byte{0x00}, 52)},
},

// Issue #39.
Expand Down
10 changes: 1 addition & 9 deletions node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2689,15 +2689,7 @@ var setStringTests = []struct {
Tag: "!!str",
Style: yaml.LiteralStyle,
},
}, {
"\x80\x81\x82",
"!!binary gIGC\n",
yaml.Node{
Kind: yaml.ScalarNode,
Value: "gIGC",
Tag: "!!binary",
},
},
},
}

func (s *S) TestSetString(c *C) {
Expand Down