Skip to content

Commit bdaa45f

Browse files
committed
Fixes for go versions 1.11 and 1.12
1 parent 571007c commit bdaa45f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

decode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ func (p *hjsonParser) readTfnns(dest reflect.Value, t reflect.Type) (interface{}
465465
// therefore we also check if dest.Addr() implements encoding.TextUnmarshaler.
466466
// But "null" is a special case: unmarshal it as nil if the original
467467
// destination type is a pointer.
468-
if chf == 'n' && !p.nodeDestination && t != nil && t.Kind() == reflect.Pointer &&
468+
if chf == 'n' && !p.nodeDestination && t != nil && t.Kind() == reflect.Ptr &&
469469
strings.TrimSpace(value.String()) == "null" {
470470

471471
return p.maybeWrapNode(&node, nil)

hjson_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ func (c *itsJ) UnmarshalText(text []byte) error {
16931693
}
16941694

16951695
func (c itsJ) MarshalJSON() ([]byte, error) {
1696-
return []byte("{\"anon\": \"" + strings.ReplaceAll(c.anon, "\"", "\\\"") + "\"}"), nil
1696+
return []byte("{\"anon\": \"" + strings.Replace(c.anon, "\"", "\\\"", -1) + "\"}"), nil
16971697
}
16981698

16991699
type itsK *itsJ

0 commit comments

Comments
 (0)