MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / fromMap

Function fromMap

pkg/util/json/json.go:921–941  ·  view source on GitHub ↗
(v map[string]interface{})

Source from the content-addressed store, hash-verified

919}
920
921func fromMap(v map[string]interface{}) (JSON, error) {
922 keys := make([]string, len(v))
923 i := 0
924 for k := range v {
925 keys[i] = k
926 i++
927 }
928 sort.Strings(keys)
929 result := make([]jsonKeyValuePair, len(v))
930 for i := range keys {
931 v, err := MakeJSON(v[keys[i]])
932 if err != nil {
933 return nil, err
934 }
935 result[i] = jsonKeyValuePair{
936 k: jsonString(keys[i]),
937 v: v,
938 }
939 }
940 return jsonObject(result), nil
941}
942
943// FromInt returns a JSON value given a int.
944func FromInt(v int) JSON {

Callers 1

MakeJSONFunction · 0.85

Calls 3

MakeJSONFunction · 0.85
jsonStringTypeAlias · 0.85
jsonObjectTypeAlias · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…