Let's Go Three

作者: zgq_70ae | 来源:发表于2018-11-18 22:36 被阅读0次

Three

os.Getid() 过去当前用户所在组ID

例子 :str := os.Getid() 返回一个int
fmt.Printf("%s", str)
运行程序:
go run main.go
打印结果:
1000

os.Getegid()返回调用者的有效组ID

例子 :str := os.Geteid() 返回一个int
fmt.Printf("%s", str)
运行程序:
go run main.go
打印结果:
1000

os.Getgroups()返回调用者的有效组ID

例子 :str, _ := os.Getgroups() 返回一个int和一个错误类型
fmt.Printf("%s", str)
运行程序:
go run main.go
打印结果:
[4 24 27 30 46 115 128 1000]

os.Getpid()返回调用者所在进程的进程ID

例子 :str := os.Getpid() 返回一个int
fmt.Printf("%s", str)
运行程序:
go run main.go
打印结果:
5297

os.Getppid()返回调用者所在进程的父进程的进程ID

例子 :str := os.Getppid() 返回一个int
fmt.Printf("%s", str)
运行程序:
go run main.go
打印结果:
5611

good bye~

相关文章

  • 2017-05-12

    游戏1《three little duck》baby look,there is a pool,let' go s...

  • 清华百人工程201704期144号赵子彧5月11日打卡

    游戏1《three little duck》baby look,there is a pool,let' go s...

  • Let's Go Three

    Three 还是fmt包 fmt.Print(“将变量转换为字符串类型并写如到os.Stdout标准输出中”) 返...

  • Let's Go Three

    Three os.Getid() 过去当前用户所在组ID 例子 :str := os.Getid() 返回一个in...

  • string

    a='let\'s go\n!go' print(a) # let's go !go print('Ru\noob...

  • one two three let's go

    秋风习习,燕儿南归。亲爱的!是不是你也加快了步伐,增添了外衣。 瞧,一个个背着书包,拎着书袋,奔向自己的母校。无论...

  • one two three let's go

    秋风习习,燕儿南归。亲爱的!是不是你也加快了步伐,增添了外衣。 瞧,一个个背着书包,拎着书袋,奔向自己的母校。无论...

  • 去医院

    Let's go to the hospital./Let's go to see a doctor. 我们去医院...

  • 无数的第一次

    Let's go!

  • 咬文嚼字823《Go: go,go,let’s go》

    【字句】Go,let’s go!Let’s go home! 【行文】准备写英文?怎么可能呢?如果选择英文行文那就...

网友评论

    本文标题:Let's Go Three

    本文链接:https://www.haomeiwen.com/subject/pusnfqtx.html