blob: 27fe6b56140af4541834211215a178816dd2d45e [file] [log] [blame]
package main
type errType string
const constErr errType = "blah"
func (et errType) Error() string {
return string(et)
}
var errVar error = errType("foo")
func genErr(i int) error {
switch i {
case 0:
return constErr
case 1:
return errVar
default:
return nil
}
}
func main() {
err := genErr(0) // @whicherrs localerrs "err"
_ = err
}