Skip to content

Instantly share code, notes, and snippets.

@hnakamur
Created September 9, 2014 22:22
Show Gist options
  • Save hnakamur/e65e3cae0501dda3c337 to your computer and use it in GitHub Desktop.
Save hnakamur/e65e3cae0501dda3c337 to your computer and use it in GitHub Desktop.
example using github.com/danryan/go-group/os/group
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