go-hep.org/x/hep@v0.38.1/xrootd/xrdproto/auth/unix/lookupgid_unix.go (about) 1 // Copyright ©2018 The go-hep Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 //go:build !windows 6 7 package unix // import "go-hep.org/x/hep/xrootd/xrdproto/auth/unix" 8 9 import ( 10 "os/user" 11 ) 12 13 func lookupGroupID(usr *user.User) (string, error) { 14 group, err := user.LookupGroupId(usr.Gid) 15 if err != nil { 16 return "", err 17 } 18 return group.Name, nil 19 }