std: remove unused bits of code all over the place

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>
This commit is contained in:
Daniel Martí 2019-09-02 14:17:23 +02:00
parent d5fe73393c
commit 03ac39ce5e
9 changed files with 6 additions and 84 deletions

View file

@ -527,11 +527,6 @@ func (n name) pkgPath() string {
return pkgPathName.name()
}
// round n up to a multiple of a. a must be a power of 2.
func round(n, a uintptr) uintptr {
return (n + a - 1) &^ (a - 1)
}
func newName(n, tag string, exported bool) name {
if len(n) > 1<<16-1 {
panic("reflect.nameFrom: name too long: " + n)
@ -867,10 +862,6 @@ func (t *rtype) PkgPath() string {
return t.nameOff(ut.pkgPath).name()
}
func hasPrefix(s, prefix string) bool {
return len(s) >= len(prefix) && s[:len(prefix)] == prefix
}
func (t *rtype) hasName() bool {
return t.tflag&tflagNamed != 0
}