diff options
author | Ivan Krasin <imkrasin@gmail.com> | 2012-03-30 21:35:19 +0000 |
---|---|---|
committer | Ivan Krasin <imkrasin@gmail.com> | 2012-03-30 21:36:39 +0000 |
commit | aafd8938e95ba03f6c84c9cd3b0b79b648d5836b (patch) | |
tree | 0d718db9f1ce2da021bb6a58f8d27e62fdd936f0 /gcd.go | |
parent | 63065370ef5f25916704c83bd50c092968f68d53 (diff) | |
download | gcd-aafd8938e95ba03f6c84c9cd3b0b79b648d5836b.tar.gz |
gcd.go: skip os.Args[0] which is the path to the binary
Diffstat (limited to 'gcd.go')
-rw-r--r-- | gcd.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -45,11 +45,11 @@ func gcdn(ns []uint64) (r uint64) { } func main() { - if len(os.Args) == 0 { + if len(os.Args) == 1 { return } var ns []uint64 // We have garbage collector! - for _, arg := range os.Args { + for _, arg := range os.Args[1:] { // Drop the second return value (error code): v, _ := strconv.ParseUint(arg, 0, 64) ns = append(ns, v) |