Skip to content

Commit

Permalink
std: remove unused bits of code all over the place
Browse files Browse the repository at this point in the history
Some were never used, and some haven't been used for years.

One exception is net/http's readerAndCloser, which was only used in a
test. Move it to a test file.

While at it, remove a check in regexp that could never fire; the field
is an uint32, so it can never be negative.

Change-Id: Ia2200f6afa106bae4034045ea8233b452f38747b
Reviewed-on: https://go-review.googlesource.com/c/go/+/192621
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
mvdan committed Sep 2, 2019
1 parent de2899b commit 654af3b
Showing 1 changed file with 0 additions and 35 deletions.
35 changes: 0 additions & 35 deletions decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1744,41 +1744,6 @@ type NullTest struct {
Struct struct{}
}

type NullTestStrings struct {
Bool bool `json:",string"`
Int int `json:",string"`
Int8 int8 `json:",string"`
Int16 int16 `json:",string"`
Int32 int32 `json:",string"`
Int64 int64 `json:",string"`
Uint uint `json:",string"`
Uint8 uint8 `json:",string"`
Uint16 uint16 `json:",string"`
Uint32 uint32 `json:",string"`
Uint64 uint64 `json:",string"`
Float32 float32 `json:",string"`
Float64 float64 `json:",string"`
String string `json:",string"`
PBool *bool `json:",string"`
Map map[string]string `json:",string"`
Slice []string `json:",string"`
Interface interface{} `json:",string"`

PRaw *RawMessage `json:",string"`
PTime *time.Time `json:",string"`
PBigInt *big.Int `json:",string"`
PText *MustNotUnmarshalText `json:",string"`
PBuffer *bytes.Buffer `json:",string"`
PStruct *struct{} `json:",string"`

Raw RawMessage `json:",string"`
Time time.Time `json:",string"`
BigInt big.Int `json:",string"`
Text MustNotUnmarshalText `json:",string"`
Buffer bytes.Buffer `json:",string"`
Struct struct{} `json:",string"`
}

// JSON null values should be ignored for primitives and string values instead of resulting in an error.
// Issue 2540
func TestUnmarshalNulls(t *testing.T) {
Expand Down

0 comments on commit 654af3b

Please sign in to comment.