@@ -22,17 +22,17 @@ type JSONMapItem = jsonutils.JSONMapItem
2222// WriteJSON writes json data.
2323//
2424// Deprecated: use [jsonutils.WriteJSON] instead.
25- func WriteJSON (data interface {} ) ([]byte , error ) { return jsonutils .WriteJSON (data ) }
25+ func WriteJSON (data any ) ([]byte , error ) { return jsonutils .WriteJSON (data ) }
2626
2727// ReadJSON reads json data.
2828//
2929// Deprecated: use [jsonutils.ReadJSON] instead.
30- func ReadJSON (data []byte , value interface {} ) error { return jsonutils .ReadJSON (data , value ) }
30+ func ReadJSON (data []byte , value any ) error { return jsonutils .ReadJSON (data , value ) }
3131
3232// DynamicJSONToStruct converts an untyped JSON structure into a target data type.
3333//
3434// Deprecated: use [jsonutils.FromDynamicJSON] instead.
35- func DynamicJSONToStruct (data interface {} , target interface {} ) error {
35+ func DynamicJSONToStruct (data any , target any ) error {
3636 return jsonutils .FromDynamicJSON (data , target )
3737}
3838
@@ -46,8 +46,8 @@ func ConcatJSON(blobs ...[]byte) []byte { return jsonutils.ConcatJSON(blobs...)
4646// It is the same as [FromDynamicJSON], but doesn't check for errors.
4747//
4848// Deprecated: this function is a misnomer and is unsafe. Use [jsonutils.FromDynamicJSON] instead.
49- func ToDynamicJSON (value interface {}) interface {} {
50- var res interface {}
49+ func ToDynamicJSON (value any ) any {
50+ var res any
5151 if err := FromDynamicJSON (value , & res ); err != nil {
5252 log .Println (err )
5353 }
@@ -57,9 +57,9 @@ func ToDynamicJSON(value interface{}) interface{} {
5757
5858// FromDynamicJSON turns a go value into a properly JSON typed structure.
5959//
60- // "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped interface{} ,
61- // i.e. objects are represented by map[string]interface{} , arrays by []interface{} , and all
62- // scalar values are interface{} .
60+ // "Dynamic JSON" refers to what you get when unmarshaling JSON into an untyped any ,
61+ // i.e. objects are represented by map[string]any , arrays by []any , and all
62+ // scalar values are any .
6363//
6464// Deprecated: use [jsonutils.FromDynamicJSON] instead.
65- func FromDynamicJSON (data , target interface {} ) error { return jsonutils .FromDynamicJSON (data , target ) }
65+ func FromDynamicJSON (data , target any ) error { return jsonutils .FromDynamicJSON (data , target ) }
0 commit comments