userinfo

package module
v0.0.0-...-bd826df Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

userinfo provides some rudimentary user information.

Is this a superior approach to os/user?
  No, it definitely is not!

Why do you use it then?
  It is lightweight and available.

Is it secure?
  Well, kind of. Environment variables are passed on execution and are only supposed to be mutable by the attached process for it's lifetime.
  The pwd.h/registry requesting way in os/user is better though as it respects changes to the useraccount even if the process is already running.

What about reliability?
  No guarantee. If the used static env value is not set, then you'll receive an empty value.
  If you fork a process with a different user and preserve environment variables on that call, you may run into trouble.

So what is this about?
  I did not want to use CGO.

In the end, please check your applications threat model.

Index

Constants

View Source
const (
	Separator string = "/"
)

Variables

This section is empty.

Functions

func Home

func Home() (string, error)

func LocalAppData

func LocalAppData() (string, error)

func Username

func Username() (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL