Golang os.Getgroups() function example

package os

Golang os.Getgroups() function usage example

 package main 

 import ( 
 "fmt" 
 "os" 
 ) 

 func main() { 

 groups, err := os.Getgroups() 

 if err != nil {
 panic(err)
 }

 for _, v := range groups {
 fmt.Printf(" %v \n", v)
 }

 }

Reference :

http://golang.org/pkg/os/#Getgroups

Advertisement