]> Cypherpunks.ru repositories - gostls13.git/blobdiff - test/nil.go
cmd/compile/internal/inline: score call sites exposed by inlines
[gostls13.git] / test / nil.go
index 9f7bcbb59fdb6182b2528f82bfd0019382eb62d0..f8300bf56afb4f9135ef490f4a36ce0e35fb186e 100644 (file)
@@ -115,7 +115,7 @@ func chantest() {
        })
        shouldBlock(func() {
                x, ok := <-ch
-               println(x, ok)
+               println(x, ok) // unreachable
        })
 
        if len(ch) != 0 {
@@ -147,13 +147,13 @@ func maptest() {
                panic(v)
        }
 
+       // can delete (non-existent) entries
+       delete(m, 2)
+
        // but cannot be written to
        shouldPanic(func() {
                m[2] = 3
        })
-       shouldPanic(func() {
-               delete(m, 2)
-       })
 }
 
 // nil slice