failed *bool
}
-func (r Recur) String() string {
+func (r *Recur) String() string {
if recurCount++; recurCount > 10 {
*r.failed = true
return "FAIL"
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")
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'
var (
intBits = reflect.TypeOf(0).Bits()
- floatBits = reflect.TypeOf(0.0).Bits()
- complexBits = reflect.TypeOf(1i).Bits()
uintptrBits = reflect.TypeOf(uintptr(0)).Bits()
)
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")
float32Val float32
float64Val float64
stringVal string
- stringVal1 string
bytesVal []byte
runeVal rune
complex64Val complex64