mustJSON / jsonDecode are tiny wrappers around encoding/json.
(v any)
| 924 | |
| 925 | // mustJSON / jsonDecode are tiny wrappers around encoding/json. |
| 926 | func mustJSON(v any) string { |
| 927 | b, err := marshalJSON(v) |
| 928 | if err != nil { |
| 929 | return "{}" |
| 930 | } |
| 931 | return string(b) |
| 932 | } |
| 933 | |
| 934 | // marshalJSON is the real marshaller; kept distinct so mustJSON above |
| 935 | // can be unit-tested without importing encoding/json directly here. |
no outgoing calls
no test coverage detected