Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1123)

Unified Diff: test/fixedbugs/bug097.go

Issue 850041: code review 850041: single argument panic (Closed)
Patch Set: code review 850041: single argument panic Created 15 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/fixedbugs/bug084.go ('k') | test/fixedbugs/bug110.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/fixedbugs/bug097.go
===================================================================
--- a/test/fixedbugs/bug097.go
+++ b/test/fixedbugs/bug097.go
@@ -6,16 +6,22 @@
package main
-type A []int;
+type A []int
func main() {
- var a [3]A;
+ var a [3]A
for i := 0; i < 3; i++ {
- a[i] = A{i};
+ a[i] = A{i}
}
- if a[0][0] != 0 { panic(); }
- if a[1][0] != 1 { panic(); }
- if a[2][0] != 2 { panic(); }
+ if a[0][0] != 0 {
+ panic("fail a[0][0]")
+ }
+ if a[1][0] != 1 {
+ panic("fail a[1][0]")
+ }
+ if a[2][0] != 2 {
+ panic("fail a[2][0]")
+ }
}
/*
@@ -41,7 +47,7 @@
*/
/* An array composite literal needs to be created freshly every time.
- It is a "construction" of an array after all. If I pass the address
- of the array to some function, it may store it globally. Same applies
- to struct literals.
+It is a "construction" of an array after all. If I pass the address
+of the array to some function, it may store it globally. Same applies
+to struct literals.
*/
« no previous file with comments | « test/fixedbugs/bug084.go ('k') | test/fixedbugs/bug110.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b