Skip to content

Commit

Permalink
Comment about key order
Browse files Browse the repository at this point in the history
  • Loading branch information
pietern committed Oct 28, 2024
1 parent 4741593 commit 3c3ef41
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libs/dyn/jsonsaver/saver.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import (

// Marshal is a version of [json.Marshal] for [dyn.Value].
//
// Objects in the output retain the order of keys as they appear in the underlying [dyn.Value].
// The output does not escape HTML characters in strings.
func Marshal(v dyn.Value) ([]byte, error) {
return marshalNoEscape(wrap{v})
}

// MarshalIndent is a version of [json.MarshalIndent] for [dyn.Value].
//
// Objects in the output retain the order of keys as they appear in the underlying [dyn.Value].
// The output does not escape HTML characters in strings.
func MarshalIndent(v dyn.Value, prefix, indent string) ([]byte, error) {
return marshalIndentNoEscape(wrap{v}, prefix, indent)
Expand Down

0 comments on commit 3c3ef41

Please sign in to comment.