mirror of
https://github.com/golang/go
synced 2024-11-19 20:54:39 -07:00
various: deleted unused items
R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/12396043
This commit is contained in:
parent
8a7def2b3b
commit
16c9d3616a
@ -50,8 +50,6 @@ type tx struct {
|
|||||||
x int
|
x int
|
||||||
}
|
}
|
||||||
|
|
||||||
var txType = reflect.TypeOf((*tx)(nil)).Elem()
|
|
||||||
|
|
||||||
// A type that can unmarshal itself.
|
// A type that can unmarshal itself.
|
||||||
|
|
||||||
type unmarshaler struct {
|
type unmarshaler struct {
|
||||||
@ -1070,7 +1068,6 @@ func TestUnmarshalNulls(t *testing.T) {
|
|||||||
|
|
||||||
func TestStringKind(t *testing.T) {
|
func TestStringKind(t *testing.T) {
|
||||||
type stringKind string
|
type stringKind string
|
||||||
type aMap map[stringKind]int
|
|
||||||
|
|
||||||
var m1, m2 map[stringKind]int
|
var m1, m2 map[stringKind]int
|
||||||
m1 = map[stringKind]int{
|
m1 = map[stringKind]int{
|
||||||
|
@ -187,16 +187,6 @@ func unescape(b []byte) []byte {
|
|||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
// lower lower-cases the A-Z bytes in b in-place, so that "aBc" becomes "abc".
|
|
||||||
func lower(b []byte) []byte {
|
|
||||||
for i, c := range b {
|
|
||||||
if 'A' <= c && c <= 'Z' {
|
|
||||||
b[i] = c + 'a' - 'A'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return b
|
|
||||||
}
|
|
||||||
|
|
||||||
const escapedChars = `&'<>"`
|
const escapedChars = `&'<>"`
|
||||||
|
|
||||||
func escape(w writer, s string) error {
|
func escape(w writer, s string) error {
|
||||||
|
@ -30,16 +30,3 @@ func isToken(s string) bool {
|
|||||||
}
|
}
|
||||||
return strings.IndexFunc(s, isNotTokenChar) < 0
|
return strings.IndexFunc(s, isNotTokenChar) < 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// isQText returns true if rune is in 'qtext' as defined by RFC 822.
|
|
||||||
func isQText(r int) bool {
|
|
||||||
// CHAR = <any ASCII character> ; ( 0-177, 0.-127.)
|
|
||||||
// qtext = <any CHAR excepting <">, ; => may be folded
|
|
||||||
// "\" & CR, and including
|
|
||||||
// linear-white-space>
|
|
||||||
switch r {
|
|
||||||
case '"', '\\', '\r':
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return r < 0x80
|
|
||||||
}
|
|
||||||
|
@ -14,7 +14,6 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Tree is the representation of a single parsed template.
|
// Tree is the representation of a single parsed template.
|
||||||
@ -200,27 +199,6 @@ func (t *Tree) stopParse() {
|
|||||||
t.funcs = nil
|
t.funcs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// atEOF returns true if, possibly after spaces, we're at EOF.
|
|
||||||
func (t *Tree) atEOF() bool {
|
|
||||||
for {
|
|
||||||
token := t.peek()
|
|
||||||
switch token.typ {
|
|
||||||
case itemEOF:
|
|
||||||
return true
|
|
||||||
case itemText:
|
|
||||||
for _, r := range token.val {
|
|
||||||
if !unicode.IsSpace(r) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
t.next() // skip spaces.
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Parse parses the template definition string to construct a representation of
|
// Parse parses the template definition string to construct a representation of
|
||||||
// the template for execution. If either action delimiter string is empty, the
|
// the template for execution. If either action delimiter string is empty, the
|
||||||
// default ("{{" or "}}") is used. Embedded template definitions are added to
|
// default ("{{" or "}}") is used. Embedded template definitions are added to
|
||||||
|
@ -669,7 +669,6 @@ const (
|
|||||||
daysPer400Years = 365*400 + 97
|
daysPer400Years = 365*400 + 97
|
||||||
daysPer100Years = 365*100 + 24
|
daysPer100Years = 365*100 + 24
|
||||||
daysPer4Years = 365*4 + 1
|
daysPer4Years = 365*4 + 1
|
||||||
days1970To2001 = 31*365 + 8
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// date computes the year, day of year, and when full=true,
|
// date computes the year, day of year, and when full=true,
|
||||||
|
@ -178,19 +178,6 @@ func (l *Location) lookupName(name string, unix int64) (offset int, isDST bool,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// lookupOffset returns information about the time zone with
|
|
||||||
// the given offset (such as -5*60*60).
|
|
||||||
func (l *Location) lookupOffset(offset int) (name string, isDST bool, ok bool) {
|
|
||||||
l = l.get()
|
|
||||||
for i := range l.zone {
|
|
||||||
zone := &l.zone[i]
|
|
||||||
if zone.offset == offset {
|
|
||||||
return zone.name, zone.isDST, true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// NOTE(rsc): Eventually we will need to accept the POSIX TZ environment
|
// NOTE(rsc): Eventually we will need to accept the POSIX TZ environment
|
||||||
// syntax too, but I don't feel like implementing it today.
|
// syntax too, but I don't feel like implementing it today.
|
||||||
|
|
||||||
|
@ -11,10 +11,6 @@ package time
|
|||||||
|
|
||||||
import "errors"
|
import "errors"
|
||||||
|
|
||||||
const (
|
|
||||||
headerSize = 4 + 16 + 4*7
|
|
||||||
)
|
|
||||||
|
|
||||||
// Simple I/O interface to binary blob of data.
|
// Simple I/O interface to binary blob of data.
|
||||||
type data struct {
|
type data struct {
|
||||||
p []byte
|
p []byte
|
||||||
|
Loading…
Reference in New Issue
Block a user