aboutsummaryrefslogtreecommitdiff
path: root/src/os
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2021-06-23 20:01:33 -0700
committerTobias Klauser <tobias.klauser@gmail.com>2021-08-28 18:48:37 +0000
commitf4cd001b57d91d24843325578a7bbd24dfc628fc (patch)
treef877353c39f7bad892db8ecf307d51ce4a908841 /src/os
parent6df3aac4ae8d0ca695751ef828a500cd438b00f9 (diff)
downloadgo-f4cd001b57d91d24843325578a7bbd24dfc628fc.tar.gz
go-f4cd001b57d91d24843325578a7bbd24dfc628fc.zip
os/user: simplify skipping listGroups test
This is not implemented on AIX and Illumos, and we already have a mechanism to skip the test case -- let's use it. Change-Id: Idb1cc2d716cf6d0731e93dfc3aa7853b9edec41f Reviewed-on: https://go-review.googlesource.com/c/go/+/330752 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/os')
-rw-r--r--src/os/user/listgroups_aix.go6
-rw-r--r--src/os/user/listgroups_illumos.go6
-rw-r--r--src/os/user/user_test.go7
3 files changed, 12 insertions, 7 deletions
diff --git a/src/os/user/listgroups_aix.go b/src/os/user/listgroups_aix.go
index d2fdfdc6b1..fbc1deb03f 100644
--- a/src/os/user/listgroups_aix.go
+++ b/src/os/user/listgroups_aix.go
@@ -9,6 +9,12 @@ package user
import "fmt"
+// Not implemented on AIX, see golang.org/issue/30563.
+
+func init() {
+ groupListImplemented = false
+}
+
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/listgroups_illumos.go b/src/os/user/listgroups_illumos.go
index d25e0339b9..e783b26080 100644
--- a/src/os/user/listgroups_illumos.go
+++ b/src/os/user/listgroups_illumos.go
@@ -13,6 +13,12 @@ package user
import "fmt"
+// Not implemented on illumos, see golang.org/issue/14709.
+
+func init() {
+ groupListImplemented = false
+}
+
func listGroups(u *User) ([]string, error) {
return nil, fmt.Errorf("user: list groups for %s: not supported on illumos", u.Username)
}
diff --git a/src/os/user/user_test.go b/src/os/user/user_test.go
index d8a465edac..80251749a7 100644
--- a/src/os/user/user_test.go
+++ b/src/os/user/user_test.go
@@ -5,7 +5,6 @@
package user
import (
- "runtime"
"testing"
)
@@ -128,12 +127,6 @@ func checkGroupList(t *testing.T) {
func TestGroupIds(t *testing.T) {
checkGroupList(t)
- if runtime.GOOS == "aix" {
- t.Skip("skipping GroupIds, see golang.org/issue/30563")
- }
- if runtime.GOOS == "illumos" {
- t.Skip("skipping GroupIds, see golang.org/issue/14709")
- }
user, err := Current()
if err != nil {
t.Fatalf("Current(): %v", err)