Skip to content

Commit f4cd001

Browse files
kolyshkintklauser
authored andcommitted
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 <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Go Bot <[email protected]>
1 parent 6df3aac commit f4cd001

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

src/os/user/listgroups_aix.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ package user
99

1010
import "fmt"
1111

12+
// Not implemented on AIX, see golang.org/issue/30563.
13+
14+
func init() {
15+
groupListImplemented = false
16+
}
17+
1218
func listGroups(u *User) ([]string, error) {
1319
return nil, fmt.Errorf("user: list groups for %s: not supported on AIX", u.Username)
1420
}

src/os/user/listgroups_illumos.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ package user
1313

1414
import "fmt"
1515

16+
// Not implemented on illumos, see golang.org/issue/14709.
17+
18+
func init() {
19+
groupListImplemented = false
20+
}
21+
1622
func listGroups(u *User) ([]string, error) {
1723
return nil, fmt.Errorf("user: list groups for %s: not supported on illumos", u.Username)
1824
}

src/os/user/user_test.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
package user
66

77
import (
8-
"runtime"
98
"testing"
109
)
1110

@@ -128,12 +127,6 @@ func checkGroupList(t *testing.T) {
128127

129128
func TestGroupIds(t *testing.T) {
130129
checkGroupList(t)
131-
if runtime.GOOS == "aix" {
132-
t.Skip("skipping GroupIds, see golang.org/issue/30563")
133-
}
134-
if runtime.GOOS == "illumos" {
135-
t.Skip("skipping GroupIds, see golang.org/issue/14709")
136-
}
137130
user, err := Current()
138131
if err != nil {
139132
t.Fatalf("Current(): %v", err)

0 commit comments

Comments
 (0)