diff options
author | Rob Pike <r@golang.org> | 2008-06-24 15:31:03 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2008-06-24 15:31:03 -0700 |
commit | 2987c8434b205a3047c59200b4fb1e618d58859c (patch) | |
tree | 0942c906740dc658d937a24f45d8ca6809b282d8 /test/args.go | |
parent | 87dae02a636e61895d8f084e9584befacc724d3f (diff) | |
download | go-2987c8434b205a3047c59200b4fb1e618d58859c.tar.gz go-2987c8434b205a3047c59200b4fb1e618d58859c.zip |
arguments available
argc, argv, envc, envv all in sys now
sys.argc() etc.
SVN=124398
Diffstat (limited to 'test/args.go')
-rw-r--r-- | test/args.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/args.go b/test/args.go new file mode 100644 index 0000000000..684cc46009 --- /dev/null +++ b/test/args.go @@ -0,0 +1,19 @@ +// $G $F.go && $L $F.$A && ./$A.out arg1 arg2 + +// Copyright 2009 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package main + +func main() { + if sys.argc() != 3 { + panic "argc" + } + if sys.argv(1) != "arg1" { + panic "arg1" + } + if sys.argv(2) != "arg2" { + panic "arg2" + } +} |