HOME/Articles/

Golang golang-if (snippet)

Article Outline

Go programming example 'golang-if'

golang-if

Golang beginners example: golang-if

package main

import (
    "fmt"
    "os"
)

func main() {
    if os.Args[1] == "Hello" {
        fmt.Println("Hello World")
    } else {
        fmt.Println("Hack the Planet")
    }
}