Commit 143fd8ef authored by Elias Naur's avatar Elias Naur

os/user: use the stubs fallback for Android

Using the stubs, user.Current will no longer fail on Android, fixing
the os/exec.TestCredentialNoSetGroups test.

Change-Id: I8b9842aa6704c0cde383c549a614bab0a0ed7695
Reviewed-on: https://go-review.googlesource.com/37765
Run-TryBot: Elias Naur <elias.naur@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent e99dafc4
...@@ -8,15 +8,6 @@ package user ...@@ -8,15 +8,6 @@ package user
import "errors" import "errors"
func init() {
userImplemented = false
groupImplemented = false
}
func current() (*User, error) {
return nil, errors.New("user: Current not implemented on android")
}
func lookupUser(string) (*User, error) { func lookupUser(string) (*User, error) {
return nil, errors.New("user: Lookup not implemented on android") return nil, errors.New("user: Lookup not implemented on android")
} }
...@@ -32,7 +23,3 @@ func lookupGroup(string) (*Group, error) { ...@@ -32,7 +23,3 @@ func lookupGroup(string) (*Group, error) {
func lookupGroupId(string) (*Group, error) { func lookupGroupId(string) (*Group, error) {
return nil, errors.New("user: LookupGroupId not implemented on android") return nil, errors.New("user: LookupGroupId not implemented on android")
} }
func listGroups(*User) ([]string, error) {
return nil, errors.New("user: GroupIds not implemented on android")
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
// +build !cgo,!windows,!plan9,!android // +build !cgo,!windows,!plan9 android
package user package user
...@@ -46,6 +46,9 @@ func current() (*User, error) { ...@@ -46,6 +46,9 @@ func current() (*User, error) {
} }
func listGroups(*User) ([]string, error) { func listGroups(*User) ([]string, error) {
if runtime.GOOS == "android" {
return nil, errors.New("user: GroupIds not implemented on Android")
}
return nil, errors.New("user: GroupIds requires cgo") return nil, errors.New("user: GroupIds requires cgo")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment