| 1 |
// Copyright (c) 2026, Maxime Soulé |
| 2 |
// All rights reserved. |
| 3 |
// |
| 4 |
// This source code is licensed under the BSD-style license found in the |
| 5 |
// LICENSE file in the root directory of this source tree. |
| 6 |
|
| 7 |
//go:build !go1.27 |
| 8 |
// +build !go1.27 |
| 9 |
|
| 10 |
package td |
| 11 |
|
| 12 |
import ( |
| 13 |
"encoding/json" |
| 14 |
) |
| 15 |
|
| 16 |
// Before go1.27 this type cannot be reached from outside. |
| 17 |
type jsonv2Options interface{ private() } |
| 18 |
|
| 19 |
func joinOptions(a, b jsonv2Options) jsonv2Options { |
| 20 |
return nil |
| 21 |
} |
| 22 |
|
| 23 |
func jsonMarshal(v any, opts jsonv2Options) ([]byte, error) { |
| 24 |
return json.Marshal(v) |
| 25 |
} |
| 26 |
|
| 27 |
func jsonUnmarshal(data []byte, v any, opts jsonv2Options) error { |
| 28 |
return json.Unmarshal(data, v) |
| 29 |
} |