aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2019-02-27 15:45:18 +0100
committerIan Lance Taylor <iant@golang.org>2019-03-19 03:20:43 +0000
commitb3cfb0b3228ada12eaea404784739f51e1671652 (patch)
tree7ae889e47a1aea1fa826616a8a7a891122cadcdf /src
parentca4314d39efd5f9dfa12b2eff7a945d9ead0b69e (diff)
downloadgo-b3cfb0b3228ada12eaea404784739f51e1671652.tar.xz
os/user: allow build on aix/ppc64 with cgo
This commit adds C support for os/user package for aix/ppc64. Updates #30563 Change-Id: Id07646998a7243b1335b85b5d4fe5bc4114e2a88 Reviewed-on: https://go-review.googlesource.com/c/go/+/164039 Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/os/user/listgroups_aix.go13
-rw-r--r--src/os/user/user_test.go3
2 files changed, 16 insertions, 0 deletions
diff --git a/src/os/user/listgroups_aix.go b/src/os/user/listgroups_aix.go
new file mode 100644
index 0000000000..17de3e98d4
--- /dev/null
+++ b/src/os/user/listgroups_aix.go
@@ -0,0 +1,13 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build cgo,!osusergo
+
+package user
+
+import "fmt"
+
+func listGroups(u *User) ([]string, error) {
+ return nil, fmt.Errorf("user: list groups for %s: not supported on AIX", u.Username)
+}
diff --git a/src/os/user/user_test.go b/src/os/user/user_test.go
index 2563077eb2..eeb24dd0e0 100644
--- a/src/os/user/user_test.go
+++ b/src/os/user/user_test.go
@@ -129,6 +129,9 @@ func TestLookupGroup(t *testing.T) {
func TestGroupIds(t *testing.T) {
checkGroup(t)
+ if runtime.GOOS == "aix" {
+ t.Skip("skipping GroupIds, see golang.org/issue/30563")
+ }
if runtime.GOOS == "solaris" {
t.Skip("skipping GroupIds, see golang.org/issue/14709")
}