上一页 1 ··· 7 8 9 10 11 12 13 下一页
摘要: stdout 标准输入到标准输出 阅读全文
posted @ 2018-03-17 22:48 cucy_to 阅读(134) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "os/exec" "runtime" "time" ) func main() { var cmd string if runtime.GOOS == "windows" { cmd = "timeout" } else { cmd = "sleep" } proc := exec.Comman... 阅读全文
posted @ 2018-03-17 22:42 cucy_to 阅读(155) 评论(0) 推荐(0)
摘要: 2 阅读全文
posted @ 2018-03-17 22:30 cucy_to 阅读(85) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "os" "os/signal" "syscall" ) func main() { // Create the channel where the received // signal would be sent. The Not 阅读全文
posted @ 2018-03-17 22:22 cucy_to 阅读(123) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "os" "os/exec" "strconv" ) func main() { pid := os.Getpid() fmt.Printf("Process PID: %d \n\n", pid) prc := exec.Command("ps", "-p", strconv.Itoa(pid), "-v"... 阅读全文
posted @ 2018-03-17 22:16 cucy_to 阅读(207) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "os" "path/filepath" ) func main() { ex, err := os.Executable() if err != nil { panic(err) } // Path to executable file fmt.Println("绝对路径: ", ex) // 绝对路径... 阅读全文
posted @ 2018-03-17 22:11 cucy_to 阅读(144) 评论(0) 推荐(0)
摘要: 1 2 不存在则报错 3 设置获取删除环境变量 阅读全文
posted @ 2018-03-17 22:05 cucy_to 阅读(441) 评论(0) 推荐(0)
摘要: ```go package main import ( "flag" "fmt" "log" "os" "strings" ) // Custom type need to implement // flag.Value interface to be able to // use it in fl 阅读全文
posted @ 2018-03-17 21:55 cucy_to 阅读(897) 评论(0) 推荐(0)
摘要: ```go package main import ( "fmt" "os" ) func main() { args := os.Args // all command line args println(args) // The first argument, zero item from array, // is the name of the called binar... 阅读全文
posted @ 2018-03-17 21:41 cucy_to 阅读(138) 评论(0) 推荐(0)
摘要: ```go package main import ( "log" "runtime" ) const info = ` Application %s starting. The binary was build by GO: %s` func main() { log.Printf(info, " 阅读全文
posted @ 2018-03-17 21:25 cucy_to 阅读(1264) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 下一页