github.com/Prakhar-Agarwal-byte/moby@v0.0.0-20231027092010-a14e3e8ab87e/daemon/listeners/group_unix.go (about) 1 //go:build !windows 2 3 package listeners // import "github.com/Prakhar-Agarwal-byte/moby/daemon/listeners" 4 5 import ( 6 "fmt" 7 "strconv" 8 9 "github.com/Prakhar-Agarwal-byte/moby/pkg/idtools" 10 ) 11 12 const defaultSocketGroup = "docker" 13 14 func lookupGID(name string) (int, error) { 15 group, err := idtools.LookupGroup(name) 16 if err == nil { 17 return group.Gid, nil 18 } 19 gid, err := strconv.Atoi(name) 20 if err == nil { 21 return gid, nil 22 } 23 return -1, fmt.Errorf("group %s not found", name) 24 }