OS kits for Golang development.
go get -u github.com/likexian/gokit
import (
"github.com/likexian/gokit/xos"
)
Visit the docs on GoDoc
uid, gid, err := xos.LookupUser("nobody")
if err == nil {
fmt.Println("uid=", uid, "gid=", gid)
}
err := xos.SetUser("nobody")
if err != nil {
fmt.Println("set user failed", err)
}
Copyright 2012-2024 Li Kexian
Licensed under the Apache License 2.0
If this project is helpful, please share it with friends.
If you want to thank me, you can give me a cup of coffee.