📌  相关文章
📜  golang 命令行参数 - Go 编程语言 - Go 编程语言代码示例

📅  最后修改于: 2022-03-11 14:44:59.927000             🧑  作者: Mango

代码示例1
package main
import (
    "fmt"
    "os"
)
func main() {

    argsWithProg := os.Args
    argsWithoutProg := os.Args[1:]
You can get individual args with normal indexing.

    arg := os.Args[3]
    fmt.Println(argsWithProg)
    fmt.Println(argsWithoutProg)
    fmt.Println(arg)
}