mirror of
https://github.com/golang/go
synced 2024-11-12 01:10:21 -07:00
all: remove various unused unexported functions and constants.
R=golang-dev, minux.ma, rsc CC=golang-dev, remy https://golang.org/cl/5702050
This commit is contained in:
parent
250fa82122
commit
c10f50859e
@ -169,34 +169,6 @@ func (r *checksumReader) Read(b []byte) (n int, err error) {
|
||||
|
||||
func (r *checksumReader) Close() error { return r.rc.Close() }
|
||||
|
||||
func readFileHeader(f *File, r io.Reader) error {
|
||||
var buf [fileHeaderLen]byte
|
||||
if _, err := io.ReadFull(r, buf[:]); err != nil {
|
||||
return err
|
||||
}
|
||||
b := readBuf(buf[:])
|
||||
if sig := b.uint32(); sig != fileHeaderSignature {
|
||||
return ErrFormat
|
||||
}
|
||||
f.ReaderVersion = b.uint16()
|
||||
f.Flags = b.uint16()
|
||||
f.Method = b.uint16()
|
||||
f.ModifiedTime = b.uint16()
|
||||
f.ModifiedDate = b.uint16()
|
||||
f.CRC32 = b.uint32()
|
||||
f.CompressedSize = b.uint32()
|
||||
f.UncompressedSize = b.uint32()
|
||||
filenameLen := int(b.uint16())
|
||||
extraLen := int(b.uint16())
|
||||
d := make([]byte, filenameLen+extraLen)
|
||||
if _, err := io.ReadFull(r, d); err != nil {
|
||||
return err
|
||||
}
|
||||
f.Name = string(d[:filenameLen])
|
||||
f.Extra = d[filenameLen:]
|
||||
return nil
|
||||
}
|
||||
|
||||
// findBodyOffset does the minimum work to verify the file has a header
|
||||
// and returns the file body offset.
|
||||
func (f *File) findBodyOffset() (int64, error) {
|
||||
|
@ -23,7 +23,6 @@ var (
|
||||
ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")
|
||||
ErrBufferFull = errors.New("bufio: buffer full")
|
||||
ErrNegativeCount = errors.New("bufio: negative count")
|
||||
errInternal = errors.New("bufio: internal error")
|
||||
)
|
||||
|
||||
// Buffered input.
|
||||
|
@ -189,11 +189,6 @@ func (e *MarshalerError) Error() string {
|
||||
return "json: error calling MarshalJSON for type " + e.Type.String() + ": " + e.Err.Error()
|
||||
}
|
||||
|
||||
type interfaceOrPtrValue interface {
|
||||
IsNil() bool
|
||||
Elem() reflect.Value
|
||||
}
|
||||
|
||||
var hex = "0123456789abcdef"
|
||||
|
||||
// An encodeState encodes JSON into a bytes.Buffer.
|
||||
|
@ -14,14 +14,6 @@ func isSeparator(c byte) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func isSpace(c byte) bool {
|
||||
switch c {
|
||||
case ' ', '\t', '\r', '\n':
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func isCtl(c byte) bool { return (0 <= c && c <= 31) || c == 127 }
|
||||
|
||||
func isChar(c byte) bool { return 0 <= c && c <= 127 }
|
||||
|
@ -6,14 +6,6 @@ package time
|
||||
|
||||
import "errors"
|
||||
|
||||
const (
|
||||
numeric = iota
|
||||
alphabetic
|
||||
separator
|
||||
plus
|
||||
minus
|
||||
)
|
||||
|
||||
// These are predefined layouts for use in Time.Format.
|
||||
// The standard time used in the layouts is:
|
||||
// Mon Jan 2 15:04:05 MST 2006
|
||||
|
@ -767,10 +767,6 @@ func (t Time) UnixNano() int64 {
|
||||
return (t.sec+internalToUnix)*1e9 + int64(t.nsec)
|
||||
}
|
||||
|
||||
type gobError string
|
||||
|
||||
func (g gobError) Error() string { return string(g) }
|
||||
|
||||
const timeGobVersion byte = 1
|
||||
|
||||
// GobEncode implements the gob.GobEncoder interface.
|
||||
|
Loading…
Reference in New Issue
Block a user