Node: os.userInfo()github.com/sahilkhaire/gox/osutil
User.UserInfo
Overview
UserInfo returns the current user.
If you are coming from Node.js, the closest pattern is os.userInfo().
Method on User — call it on a value of that type after constructing or receiving one from a constructor.
Signature
go
func UserInfo() (User, error)Compare: Node.js · Standard Go · gox
js
os.userInfo()go
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.go
import "github.com/sahilkhaire/gox/osutil"
osutil.UserInfo()Example
go
import "github.com/sahilkhaire/gox/osutil"
osutil.UserInfo()Tips
Obtain a User value first (see constructors on the package overview), then call UserInfo.
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.