Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
go version go1.9.2 linux/amd64
What did you do?
// a.go
package main
func main() {
var s []int
var is interface{} = s
go func() {
_ = s == nil
}()
go func() {
_ = is == is
}()
var m map[string]bool = nil
_ = m["Go"]
_, _ = m["Go"]
m, _ = is.(map[string]bool)
m = is.(map[string]bool)
}
What did you expect to see?
$ go run a.go
panic: interface conversion: interface {} is []int, not map[string]bool
goroutine 1 [running]:
main.main()
/tmp/a.go:17 +0x15a
panic: runtime error: comparing uncomparable type []int
goroutine 19 [running]:
main.main.func2(0x45b480, 0x4cc2c0)
/tmp/a.go:10 +0x3a
created by main.main
/tmp/a.go:9 +0xc9
exit status 2
What did you see instead?
$ go run a.go
panic: interface conversion: interface {} is []int, not map[string]bool
goroutine 1 [running]:
main.main()
/tmp/a.go:17 +0x15a
panic: runtime error: comparing uncomparable type []int
goroutine 19 [running]:
main.main.func2(0x45b480, 0x4cc2c0)
/tmp/a.go:10 +0x3a
created by main.main
/tmp/a.go:9 +0xc9
exit status 2
The text was updated successfully, but these errors were encountered:
Gotcha @dotaheor. So this looks to me like an improvement that can be implemented without having to be a proposal and I can work on this. @randall77 am I right to say that we can JustDoIt (randall ™)?
odeke-em
changed the title
proposal: cmd/compile: better format for multiple runtime panics
cmd/compile: delineate multiple runtime panics with newlines between them
Dec 16, 2017
odeke-em
changed the title
cmd/compile: delineate multiple runtime panics with newlines between them
cmd/compile: delineate multiple runtime panics by adding newlines between them
Dec 16, 2017
ianlancetaylor
changed the title
cmd/compile: delineate multiple runtime panics by adding newlines between them
runtime: delineate multiple panics by adding newlines between them
Jun 30, 2018
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 linux/amd64
What did you do?
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: