Created
September 9, 2014 22:22
-
-
Save hnakamur/e65e3cae0501dda3c337 to your computer and use it in GitHub Desktop.
example using github.com/danryan/go-group/os/group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/danryan/go-group/os/group" | |
) | |
func main() { | |
g, err := group.CurrentGroup() | |
if err != nil { | |
panic(err) | |
} | |
fmt.Printf("group gid=%s, name=%s\n", g.Gid, g.Name) | |
g, err = group.LookupGroup("wheel") | |
if err != nil { | |
panic(err) | |
} | |
fmt.Printf("group gid=%s, name=%s\n", g.Gid, g.Name) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment