'sanitize' JSON input

Co-Authored-By: gballet <gballet@gmail.com>
This commit is contained in:
Martin Holst Swende 2019-04-04 09:16:34 +02:00 committed by Guillaume Ballet
parent 3b3e1bc07e
commit df5409c952

View File

@ -136,7 +136,7 @@ func (path DerivationPath) String() string {
} }
func (path DerivationPath) MarshalJSON() ([]byte, error) { func (path DerivationPath) MarshalJSON() ([]byte, error) {
return []byte(fmt.Sprintf("\"%s\"", path.String())), nil return json.Marshal(fmt.Sprintf("\"%s\"", path.String()))
} }
func (path *DerivationPath) UnmarshalJSON(b []byte) error { func (path *DerivationPath) UnmarshalJSON(b []byte) error {