Package Usage: go: github.com/tweekmonster/luser
Package luser is a drop-in replacement for 'os/user' which allows you to
lookup users and groups in cross-compiled builds without 'cgo'.
'os/user' requires 'cgo' to lookup users using the target OS's API. This is
the most reliable way to look up user and group information. However,
cross-compiling means that 'os/user' will only work for the OS you're using.
'user.Current()' is usable when building without 'cgo', but doesn't always
work. The '$USER' and '$HOME' variables could be different from what you
expect or not even exist.
If you want to cross-compile a relatively simple program that needs to write
a config file somewhere in the user's directory, the last thing you want to
do is figure out some elaborate build scheme involving virtual machines.
When cgo is not available for a build, one of the following methods will be
used to lookup user and group information:
You should be able to simply replace 'user.' with 'luser.' (in most cases).
1 version
Latest release: almost 9 years ago
784 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/tweekmonster/luser