]> Cypherpunks repositories - gostls13.git/commitdiff
various: deleted unused items
authorRob Pike <r@golang.org>
Sat, 3 Aug 2013 06:01:04 +0000 (16:01 +1000)
committerRob Pike <r@golang.org>
Sat, 3 Aug 2013 06:01:04 +0000 (16:01 +1000)
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12396043

src/pkg/encoding/json/decode_test.go
src/pkg/html/escape.go
src/pkg/mime/grammar.go
src/pkg/text/template/parse/parse.go
src/pkg/time/time.go
src/pkg/time/zoneinfo.go
src/pkg/time/zoneinfo_read.go

index e868f4f1b7ce47cca94e76b02757b2617c748c93..3e16c4aec0dee86e6eaef20a3a2f1631b514247a 100644 (file)
@@ -50,8 +50,6 @@ type tx struct {
        x int
 }
 
-var txType = reflect.TypeOf((*tx)(nil)).Elem()
-
 // A type that can unmarshal itself.
 
 type unmarshaler struct {
@@ -1070,7 +1068,6 @@ func TestUnmarshalNulls(t *testing.T) {
 
 func TestStringKind(t *testing.T) {
        type stringKind string
-       type aMap map[stringKind]int
 
        var m1, m2 map[stringKind]int
        m1 = map[stringKind]int{
index eff0384e089e32139d266138c1ea63a5608e5dfa..dd5dfa7cd75f22a85fb4fff16a5454f572bfe065 100644 (file)
@@ -187,16 +187,6 @@ func unescape(b []byte) []byte {
        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 = `&'<>"`
 
 func escape(w writer, s string) error {
index 09e941e3ec0ddbf17c1929e6ce74770fc1123ef9..2347324aa5ada2eeeb20ac97cc84a32a68a31bd5 100644 (file)
@@ -30,16 +30,3 @@ func isToken(s string) bool {
        }
        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
-}
index 802e298c23007b604ad0bcc8a734e33d53485e2f..2919124d3b652cba5402480ad35ea68f55ac5538 100644 (file)
@@ -14,7 +14,6 @@ import (
        "runtime"
        "strconv"
        "strings"
-       "unicode"
 )
 
 // Tree is the representation of a single parsed template.
@@ -200,27 +199,6 @@ func (t *Tree) stopParse() {
        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
 // the template for execution. If either action delimiter string is empty, the
 // default ("{{" or "}}") is used. Embedded template definitions are added to
index 66971f53a67592706ec342ecc43b3e96dac06fe7..4a8ee8fd336de056fed89d42331e389545bdc0ad 100644 (file)
@@ -669,7 +669,6 @@ const (
        daysPer400Years  = 365*400 + 97
        daysPer100Years  = 365*100 + 24
        daysPer4Years    = 365*4 + 1
-       days1970To2001   = 31*365 + 8
 )
 
 // date computes the year, day of year, and when full=true,
index c44477f4743341115b341f59f7cfdcbf583c52a6..1c6186258f9b2953057268e54ed72cb651aa662c 100644 (file)
@@ -178,19 +178,6 @@ func (l *Location) lookupName(name string, unix int64) (offset int, isDST bool,
        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
 // syntax too, but I don't feel like implementing it today.
 
index 4519c996234ae0ae4d0f4bd1818174fef6e07018..7714aa9f583ae4507740d77701c4203e88841b69 100644 (file)
@@ -11,10 +11,6 @@ package time
 
 import "errors"
 
-const (
-       headerSize = 4 + 16 + 4*7
-)
-
 // Simple I/O interface to binary blob of data.
 type data struct {
        p     []byte