|author||Kir Kolyshkin <email@example.com>||Wed Jun 23 20:46:11 2021 -0700|
|committer||Ian Lance Taylor <firstname.lastname@example.org>||Tue Sep 21 23:11:47 2021 +0000|
os/user: implement go native GroupIds Currently, GroupIds (a method that returns supplementary group IDs for a user) is not implemented when cgo is not available, or osusergo build tag is set, or the underlying OS lacks getgrouplist(3). This adds a native Go implementation of GroupIds (which parses /etc/group) for such cases, together with some tests. This implementation is used: - when cgo is not available; - when osusergo build tag is set; - on AIX (which lacks getgrouplist(3)); - on Illumos (which only recently added getgrouplist(3)). This commit moves listgroups_unix.go to cgo_listgroups_unix.go, and adds listgroups_unix.go which implements the feature. NOTE the +build equivalent of go:build expression in listgroups_unix.go is not provided as it is going to be bulky. Go 1.17 already prefers go:build over +build, and no longer fail if a file contains go:build without +build, so the absence of +build is not a problem even with Go 1.17, and this code is targeted for Go 1.18. Updates #14709 Updates #30563 Change-Id: Icc95cda97ee3bcb03ef028b16eab7d3faba9ffab Reviewed-on: https://go-review.googlesource.com/c/go/+/330753 Reviewed-by: Ian Lance Taylor <email@example.com> Reviewed-by: Tobias Klauser <firstname.lastname@example.org> Run-TryBot: Ian Lance Taylor <email@example.com> TryBot-Result: Go Bot <firstname.lastname@example.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.html.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.