mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 06:36:43 +08:00
17 lines
238 B
Go
Executable File
17 lines
238 B
Go
Executable File
// hello_who.go
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func main() {
|
|
who := "World"
|
|
if len(os.Args) > 1 { // os.Args[0] == hello_who
|
|
who = strings.Join(os.Args[1:], " ")
|
|
}
|
|
fmt.Println("Hello", who, "!")
|
|
}
|