DEV Community

indiewebdev
indiewebdev

Posted on

Golang Notes - 11

Flow Control

decision making

if <condition> {
    // do smth
} else if <condition>{
    // do smth
} else {
    // do smth
}
Enter fullscreen mode Exit fullscreen mode

Command Line Arguments

fmt.Println(os.Args)
fmt.Println(len(os.Args))
Enter fullscreen mode Exit fullscreen mode

os.Args slice of strings
first element os.Args[0] path of program

Top comments (0)