Skip to content
Node: osgithub.com/sahilkhaire/gox/osutil

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.js
go
// 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.Username

Example

go
import "github.com/sahilkhaire/gox/osutil"

info, err := osutil.UserInfo()
if err != nil {
    return err
}
_ = info.Username

Tips

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.

Back to osutil package overview

MIT Licensed · Built for Node.js developers moving to Go