1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:50:21 -07:00

exp/ssa: silence go vet

R=adonovan
CC=golang-dev
https://golang.org/cl/7386052
This commit is contained in:
Rob Pike 2013-02-22 13:02:00 -08:00
parent a48ed66447
commit 96f57186ba
3 changed files with 6 additions and 3 deletions

View File

@ -586,7 +586,7 @@ func Interpret(mainpkg *ssa.Package, mode Mode, filename string, args []string)
case string:
fmt.Fprintln(os.Stderr, "panic:", p)
default:
fmt.Fprintln(os.Stderr, "panic: unexpected type: %T", p)
fmt.Fprintf(os.Stderr, "panic: unexpected type: %T\n", p)
}
// TODO(adonovan): dump panicking interpreter goroutine?

View File

@ -233,7 +233,7 @@ func ext۰reflect۰Value۰Len(fn *ssa.Function, args []value) value {
case map[value]value:
return len(v)
default:
panic(fmt.Sprintf("reflect.(Value).Len(%V)", v))
panic(fmt.Sprintf("reflect.(Value).Len(%v)", v))
}
return nil // unreachable
}

View File

@ -9,7 +9,10 @@ import (
"strconv"
)
var complexZero = types.Complex{new(big.Rat), new(big.Rat)}
var complexZero = types.Complex{
Re: new(big.Rat),
Im: new(big.Rat),
}
// newLiteral returns a new literal of the specified value and type.
// val must be valid according to the specification of Literal.Value.