forked from tailscale/hujson
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeprecated.go
More file actions
114 lines (86 loc) · 3.59 KB
/
deprecated.go
File metadata and controls
114 lines (86 loc) · 3.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package hujson
import (
"bytes"
"io"
json "github.com/tailscale/hujson/internal/hujson"
)
// Deprecated: Do not use. This will be deleted in the near future.
func Compact(dst *bytes.Buffer, src []byte) error {
return json.Compact(dst, src)
}
// Deprecated: Do not use. This will be deleted in the near future.
func HTMLEscape(dst *bytes.Buffer, src []byte) {
json.HTMLEscape(dst, src)
}
// Deprecated: Do not use. This will be deleted in the near future.
func Indent(dst *bytes.Buffer, src []byte, prefix, indent string) error {
return json.Indent(dst, src, prefix, indent)
}
// Deprecated: Do not use. This will be deleted in the near future.
func Marshal(v interface{}) ([]byte, error) {
return json.Marshal(v)
}
// Deprecated: Do not use. This will be deleted in the near future.
func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
return json.MarshalIndent(v, prefix, indent)
}
// Deprecated: Do not use. This will be deleted in the near future.
// See the "Use with the Standard Library" section for alternatives.
func NewDecoder(r io.Reader) *Decoder {
return json.NewDecoder(r)
}
// Deprecated: Do not use. This will be deleted in the near future.
func NewEncoder(w io.Writer) *Encoder {
return json.NewEncoder(w)
}
// Deprecated: Do not use. This will be deleted in the near future.
// See the "Use with the Standard Library" section for alternatives.
func Unmarshal(data []byte, v interface{}) error {
ast, err := Parse(data)
if err != nil {
return err
}
ast.Standardize()
data = ast.Pack()
return json.Unmarshal(data, v)
}
// Deprecated: Do not use. This will be deleted in the near future.
func Valid(data []byte) bool {
return json.Valid(data)
}
// Deprecated: Do not use. This will be deleted in the near future.
// See the "Use with the Standard Library" section for alternatives.
type Decoder = json.Decoder
// Deprecated: Do not use. This will be deleted in the near future.
type Delim = json.Delim
// Deprecated: Do not use. This will be deleted in the near future.
type Encoder = json.Encoder
// Deprecated: Do not use. This will be deleted in the near future.
type InvalidUnmarshalError = json.InvalidUnmarshalError
// Deprecated: Do not use. This will be deleted in the near future.
type InvalidUTF8Error = json.InvalidUTF8Error
// Deprecated: Do not use. This will be deleted in the near future.
type Marshaler = json.Marshaler
// Deprecated: Do not use. This will be deleted in the near future.
type MarshalerError = json.MarshalerError
// Deprecated: Do not use. This will be deleted in the near future.
type Number = json.Number
// Deprecated: Do not use. This will be deleted in the near future.
type RawMessage = json.RawMessage
// Deprecated: Do not use. This will be deleted in the near future.
type SyntaxError = json.SyntaxError
// Deprecated: Do not use. This will be deleted in the near future.
type Token = json.Token
// Deprecated: Do not use. This will be deleted in the near future.
type Unmarshaler = json.Unmarshaler
// Deprecated: Do not use. This will be deleted in the near future.
type UnmarshalFieldError = json.UnmarshalFieldError
// Deprecated: Do not use. This will be deleted in the near future.
type UnmarshalTypeError = json.UnmarshalTypeError
// Deprecated: Do not use. This will be deleted in the near future.
type UnsupportedTypeError = json.UnsupportedTypeError
// Deprecated: Do not use. This will be deleted in the near future.
type UnsupportedValueError = json.UnsupportedValueError