mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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>
This commit is contained in:
parent
6df3aac4ae
commit
f4cd001b57
3 changed files with 12 additions and 7 deletions
|
|
@ -9,6 +9,12 @@ package user
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Not implemented on AIX, see golang.org/issue/30563.
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
groupListImplemented = false
|
||||||
|
}
|
||||||
|
|
||||||
func listGroups(u *User) ([]string, error) {
|
func listGroups(u *User) ([]string, error) {
|
||||||
return nil, fmt.Errorf("user: list groups for %s: not supported on AIX", u.Username)
|
return nil, fmt.Errorf("user: list groups for %s: not supported on AIX", u.Username)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,12 @@ package user
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
|
||||||
|
// Not implemented on illumos, see golang.org/issue/14709.
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
groupListImplemented = false
|
||||||
|
}
|
||||||
|
|
||||||
func listGroups(u *User) ([]string, error) {
|
func listGroups(u *User) ([]string, error) {
|
||||||
return nil, fmt.Errorf("user: list groups for %s: not supported on illumos", u.Username)
|
return nil, fmt.Errorf("user: list groups for %s: not supported on illumos", u.Username)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
package user
|
package user
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"runtime"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -128,12 +127,6 @@ func checkGroupList(t *testing.T) {
|
||||||
|
|
||||||
func TestGroupIds(t *testing.T) {
|
func TestGroupIds(t *testing.T) {
|
||||||
checkGroupList(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()
|
user, err := Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Current(): %v", err)
|
t.Fatalf("Current(): %v", err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue