OLD | NEW |
1 // true | 1 // skip |
2 | 2 |
3 // Copyright 2012 The Go Authors. All rights reserved. | 3 // Copyright 2012 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 // Test method expressions with arguments. | 7 // Test method expressions with arguments. |
8 // This file is not tested by itself; it is imported by method4.go. | 8 // This file is not tested by itself; it is imported by method4.go. |
9 | 9 |
10 package method4a | 10 package method4a |
11 | 11 |
(...skipping 19 matching lines...) Expand all Loading... |
31 return r | 31 return r |
32 } | 32 } |
33 | 33 |
34 func (p *T2) Sum(a []int, b int) int { | 34 func (p *T2) Sum(a []int, b int) int { |
35 r := p.F + b | 35 r := p.F + b |
36 for _, v := range a { | 36 for _, v := range a { |
37 r += v | 37 r += v |
38 } | 38 } |
39 return r | 39 return r |
40 } | 40 } |
OLD | NEW |