User
Overview
User holds user identity fields when available (os.userInfo).
Part of the osutil package — Node.js analog: os.
User is a type exported by gox. Methods on this type are documented separately.
Signature
go
type User struct {
Username string
Uid string
Gid string
}Compare: Node.js · Standard Go · gox
js
// Typical os pattern in Node.jsgo
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.go
import "github.com/sahilkhaire/gox/osutil"
info, err := osutil.UserInfo()
if err != nil {
return err
}
_ = info.UsernameExample
go
import "github.com/sahilkhaire/gox/osutil"
info, err := osutil.UserInfo()
if err != nil {
return err
}
_ = info.UsernameTips
Browse methods on this type in the sidebar for handler-style APIs and options structs.
Standard library alternative
gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.