Commit fba7b04d authored by Rob Pike's avatar Rob Pike

fmt: clean up some errors found by vet

Includes deleting some unused items.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/12305043
parent e03dd079
......@@ -906,7 +906,7 @@ type Recur struct {
failed *bool
}
func (r Recur) String() string {
func (r *Recur) String() string {
if recurCount++; recurCount > 10 {
*r.failed = true
return "FAIL"
......@@ -919,13 +919,13 @@ func (r Recur) String() string {
func TestBadVerbRecursion(t *testing.T) {
failed := false
r := Recur{3, &failed}
r := &Recur{3, &failed}
Sprintf("recur@%p value: %d\n", &r, r.i)
if failed {
t.Error("fail with pointer")
}
failed = false
r = Recur{4, &failed}
r = &Recur{4, &failed}
Sprintf("recur@%p, value: %d\n", r, r.i)
if failed {
t.Error("fail with value")
......
......@@ -24,8 +24,6 @@ const (
var padZeroBytes = make([]byte, nByte)
var padSpaceBytes = make([]byte, nByte)
var newline = []byte{'\n'}
func init() {
for i := 0; i < nByte; i++ {
padZeroBytes[i] = '0'
......
......@@ -641,8 +641,6 @@ func (p *pp) fmtPointer(value reflect.Value, verb rune, goSyntax bool) {
var (
intBits = reflect.TypeOf(0).Bits()
floatBits = reflect.TypeOf(0.0).Bits()
complexBits = reflect.TypeOf(1i).Bits()
uintptrBits = reflect.TypeOf(uintptr(0)).Bits()
)
......
......@@ -479,11 +479,6 @@ func (s *ss) token(skipSpace bool, f func(rune) bool) []byte {
return s.buf
}
// typeError indicates that the type of the operand did not match the format
func (s *ss) typeError(arg interface{}, expected string) {
s.errorString("expected argument of type pointer to " + expected + "; found " + reflect.TypeOf(arg).String())
}
var complexError = errors.New("syntax error scanning complex number")
var boolError = errors.New("syntax error scanning boolean")
......
......@@ -54,7 +54,6 @@ var (
float32Val float32
float64Val float64
stringVal string
stringVal1 string
bytesVal []byte
runeVal rune
complex64Val complex64
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment