summaryrefslogtreecommitdiff
path: root/decode.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-01-25 23:11:06 -0700
committerLuke Shumaker <lukeshu@lukeshu.com>2023-01-25 23:20:18 -0700
commite483afa206686ce748ad270140f99fad9d713aad (patch)
tree2f65755ece7059579e902132cf0e44cb0fbbb0d6 /decode.go
parentf834aaeb56b929ed06e0545a589b7dd82b4602d3 (diff)
Delete things I don't want to document
Diffstat (limited to 'decode.go')
-rw-r--r--decode.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/decode.go b/decode.go
index fbf2373..fb94ba8 100644
--- a/decode.go
+++ b/decode.go
@@ -1,4 +1,4 @@
-// Copyright (C) 2022 Luke Shumaker <lukeshu@lukeshu.com>
+// Copyright (C) 2022-2023 Luke Shumaker <lukeshu@lukeshu.com>
//
// SPDX-License-Identifier: GPL-2.0-or-later
@@ -103,14 +103,6 @@ func (dec *Decoder) stackName() string {
return strings.Join(fields, ".")
}
-func Decode(r io.RuneScanner, ptr any) error {
- return NewDecoder(r).Decode(ptr)
-}
-
-func DecodeThenEOF(r io.RuneScanner, ptr any) error {
- return NewDecoder(r).DecodeThenEOF(ptr)
-}
-
// DecodeThenEOF is like decode, but emits an error if there is extra
// data after the JSON.
func (dec *Decoder) DecodeThenEOF(ptr any) (err error) {
@@ -494,7 +486,7 @@ func (dec *Decoder) decode(val reflect.Value, nullOK bool) {
// TODO: Figure out how to do this without buffering, have correct offsets.
var buf bytes.Buffer
dec.decodeString(nil, &buf)
- if err := Decode(bytes.NewReader(buf.Bytes()), fVal.Addr().Interface()); err != nil {
+ if err := NewDecoder(bytes.NewReader(buf.Bytes())).Decode(fVal.Addr().Interface()); err != nil {
if str := buf.String(); str != "null" {
dec.panicType("", fVal.Type(),
fmt.Errorf("json: invalid use of ,string struct tag, trying to unmarshal %q into %v",