github.com/tinygo-org/tinygo@v0.31.3-0.20240404173401-90b0bf646c27/src/os/user/user.go (about) 1 // Copyright 2016 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package user 6 7 import "errors" 8 9 // User represents a user account. 10 type User struct { 11 // Uid is the user ID. 12 // On POSIX systems, this is a decimal number representing the uid. 13 // On Windows, this is a security identifier (SID) in a string format. 14 // On Plan 9, this is the contents of /dev/user. 15 Uid string 16 // Gid is the primary group ID. 17 // On POSIX systems, this is a decimal number representing the gid. 18 // On Windows, this is a SID in a string format. 19 // On Plan 9, this is the contents of /dev/user. 20 Gid string 21 // Username is the login name. 22 Username string 23 // Name is the user's real or display name. 24 // It might be blank. 25 // On POSIX systems, this is the first (or only) entry in the GECOS field 26 // list. 27 // On Windows, this is the user's display name. 28 // On Plan 9, this is the contents of /dev/user. 29 Name string 30 // HomeDir is the path to the user's home directory (if they have one). 31 HomeDir string 32 } 33 34 // Current returns the current user. 35 // 36 // The first call will cache the current user information. 37 // Subsequent calls will return the cached value and will not reflect 38 // changes to the current user. 39 func Current() (*User, error) { 40 return nil, errors.New("user: Current not implemented") 41 }