(idVal any)
| 24 | } |
| 25 | |
| 26 | func idLiteralFromAny(idVal any) (string, error) { |
| 27 | switch v := idVal.(type) { |
| 28 | case float64: |
| 29 | return strconv.FormatInt(int64(v), 10), nil |
| 30 | case string: |
| 31 | return strconv.Quote(v), nil |
| 32 | default: |
| 33 | return "", fmt.Errorf("unsupported id type %T", v) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | func findJSONIDValue(v any) (any, bool) { |
| 38 | switch x := v.(type) { |
no test coverage detected