Russ Cox | d2cc988 | 2012-02-16 23:50:37 -0500 | [diff] [blame] | 1 | // run |
Rob Pike | ab34d15 | 2008-06-06 14:27:34 -0700 | [diff] [blame] | 2 | |
| 3 | // Copyright 2009 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
Rob Pike | eb37b5b | 2012-02-24 16:24:24 +1100 | [diff] [blame] | 7 | // Test simple multi-argument multi-valued function. |
| 8 | |
Rob Pike | ab34d15 | 2008-06-06 14:27:34 -0700 | [diff] [blame] | 9 | package main |
| 10 | |
Rob Pike | ab34d15 | 2008-06-06 14:27:34 -0700 | [diff] [blame] | 11 | func |
Robert Griesemer | 581530e | 2009-12-10 12:53:23 -0800 | [diff] [blame] | 12 | main() { |
Rob Pike | ab34d15 | 2008-06-06 14:27:34 -0700 | [diff] [blame] | 13 | var x,y int; |
| 14 | |
| 15 | x,y = simple(10,20,30); |
Rob Pike | bc2f5f1 | 2008-08-11 22:07:49 -0700 | [diff] [blame] | 16 | if x+y != 65 { panic(x+y); } |
Rob Pike | ab34d15 | 2008-06-06 14:27:34 -0700 | [diff] [blame] | 17 | } |
| 18 | |
| 19 | func |
Robert Griesemer | 581530e | 2009-12-10 12:53:23 -0800 | [diff] [blame] | 20 | simple(ia,ib,ic int) (oa,ob int) { |
Rob Pike | ab34d15 | 2008-06-06 14:27:34 -0700 | [diff] [blame] | 21 | return ia+5, ib+ic; |
| 22 | } |