Skip to content

Commit 24ceea7

Browse files
Use golang.org/x/sys/windows instead of syscall
Signed-off-by: Gabriel Adrian Samfira <[email protected]>
1 parent 9b387e4 commit 24ceea7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

util/system/getuserinfo/userinfo_windows.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import (
44
"encoding/json"
55
"fmt"
66
"os"
7-
"syscall"
7+
8+
"golang.org/x/sys/windows"
89

910
"github.com/docker/docker/pkg/idtools"
1011
"github.com/docker/docker/pkg/reexec"
@@ -24,20 +25,16 @@ func userInfoMain() {
2425
os.Exit(1)
2526
}
2627
username := os.Args[1]
27-
sid, _, _, err := syscall.LookupSID("", username)
28+
sid, _, _, err := windows.LookupSID("", username)
2829
if err != nil {
2930
fmt.Println(err)
3031
os.Exit(3)
3132
}
3233

33-
sidAsString, err := sid.String()
34-
if err != nil {
35-
fmt.Println(err)
36-
os.Exit(4)
37-
}
3834
ident := idtools.Identity{
39-
SID: sidAsString,
35+
SID: sid.String(),
4036
}
37+
4138
asJson, err := json.Marshal(ident)
4239
if err != nil {
4340
fmt.Println(err)

0 commit comments

Comments
 (0)