Created
September 22, 2010 19:37
-
-
Save gregworley/592344 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A version of echo - go/docs/GoCourseDay1.pdf slide 59 | |
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
if len(os.Args) < 2 { //length of array | |
os.Exit(1) | |
} | |
for i := 1; i < len(os.Args); i++ { | |
fmt.Printf("arg %d: %s\n", i, os.Args[i]) | |
} | |
} // falling off end == os.Exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment