OLD | NEW |
1 // $G $D/$F.go && $L $F.$A && ./$A.out | 1 // run |
2 | 2 |
3 // Copyright 2010 The Go Authors. All rights reserved. | 3 // Copyright 2010 The Go Authors. All rights reserved. |
4 // Use of this source code is governed by a BSD-style | 4 // Use of this source code is governed by a BSD-style |
5 // license that can be found in the LICENSE file. | 5 // license that can be found in the LICENSE file. |
6 | 6 |
7 package main | 7 package main |
8 | 8 |
9 func sum(args ...int) int { | 9 func sum(args ...int) int { |
10 s := 0 | 10 s := 0 |
11 for _, v := range args { | 11 for _, v := range args { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 if x := (*U).Sum(&U{}, 1, 3, 5, 2); x != 11 { | 209 if x := (*U).Sum(&U{}, 1, 3, 5, 2); x != 11 { |
210 println("(*U).Sum", x) | 210 println("(*U).Sum", x) |
211 panic("fail") | 211 panic("fail") |
212 } | 212 } |
213 if x := U.Sum(U{}, 1, 3, 5, 1); x != 10 { | 213 if x := U.Sum(U{}, 1, 3, 5, 1); x != 10 { |
214 println("U.Sum", x) | 214 println("U.Sum", x) |
215 panic("fail") | 215 panic("fail") |
216 } | 216 } |
217 */ | 217 */ |
218 } | 218 } |
OLD | NEW |