go/src/os
Daniel Martí ebdc24c3d3 os: add UserConfigDir
After UserCacheDir and UserHomeDir, the only remaining piece which is
commonly needed and portable is a per-user directory to store persistent
files.

For that purpose, UserCacheDir is wrong, as it's meant only for
temporary files. UserHomeDir is also far from ideal, as that clutters
the user's home directory.

Add UserConfigDir, which is implemented in a similar manner to
UserConfigDir.

Fixes #29960.

Change-Id: I7d7a56615103cf76e2b5e2bab2029a6b09d19f0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/160877
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-03-05 15:14:36 +00:00
..
exec os/exec: less allocs in the common case 2019-03-04 09:45:46 +00:00
signal os/signal: increase wait time for signal delivery time in testcase 2018-12-13 12:14:18 +00:00
user os: add AIX operating system 2018-10-11 15:41:04 +00:00
dir.go
dir_ios.go runtime,os,syscall,internal/poll: replace getdirentries on iOS 2018-12-13 17:10:32 +00:00
dir_plan9.go
dir_unix.go runtime,os,syscall,internal/poll: replace getdirentries on iOS 2018-12-13 17:10:32 +00:00
dir_windows.go os: use WIN32_FIND_DATA.Reserved0 to identify symlinks 2018-03-07 08:51:04 +00:00
env.go os: treat "${}" in Expand like in Go 1.10 2018-06-29 21:07:28 +00:00
env_test.go os: treat "${}" in Expand like in Go 1.10 2018-06-29 21:07:28 +00:00
env_unix_test.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
error.go os: add deadline methods for File type 2017-10-25 18:27:06 +00:00
error_plan9.go os: homogenize error checks on Plan 9 2018-01-24 07:18:36 +00:00
error_posix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
error_test.go
error_unix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
error_unix_test.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
error_windows.go
error_windows_test.go
example_test.go os: show how to print permission bits in octal 2018-12-18 21:17:16 +00:00
exec.go os/exec: document Process.Kill behaviour 2018-03-05 23:47:41 +00:00
exec_plan9.go os/exec: less allocs in the common case 2019-03-04 09:45:46 +00:00
exec_posix.go os/exec: less allocs in the common case 2019-03-04 09:45:46 +00:00
exec_unix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
exec_windows.go Revert "os: remove sleep in windows Process.Wait" 2018-11-09 23:24:35 +00:00
executable.go
executable_darwin.go os: add check for empty executable path on darwin 2018-08-02 20:31:25 +00:00
executable_freebsd.go
executable_path.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
executable_plan9.go
executable_procfs.go os: add js/wasm architecture 2018-06-01 05:18:38 +00:00
executable_solaris.go runtime: parse auxv for page size and executable name on Solaris 2018-04-03 15:49:45 +00:00
executable_test.go os: fix tests for AIX 2018-10-26 14:46:35 +00:00
executable_windows.go
export_test.go
export_windows_test.go
fifo_test.go os: skip TestFifoEOF on android 2018-06-14 13:41:57 +00:00
file.go os: add UserConfigDir 2019-03-05 15:14:36 +00:00
file_plan9.go os: add SyscallConn method for os.File 2018-12-27 16:36:34 +00:00
file_posix.go os: make Readlink work with symlinks with target like \??\Volume{ABCD}\ 2019-03-01 07:44:37 +00:00
file_unix.go os: make Readlink work with symlinks with target like \??\Volume{ABCD}\ 2019-03-01 07:44:37 +00:00
file_windows.go os: make Readlink work with symlinks with target like \??\Volume{ABCD}\ 2019-03-01 07:44:37 +00:00
getwd.go os: use the syscall version of Getwd for Plan 9 2018-01-25 00:12:18 +00:00
getwd_darwin.go
os_test.go os: return an error from UserHomeDir to match UserCacheDir 2018-11-22 20:49:16 +00:00
os_unix_test.go os: add SyscallConn method for os.File 2018-12-27 16:36:34 +00:00
os_windows_test.go os: make Readlink work with symlinks with target like \??\Volume{ABCD}\ 2019-03-01 07:44:37 +00:00
path.go os: restore RemoveAll docs by making a single copy 2019-01-30 01:39:37 +00:00
path_plan9.go path: use OS-specific function in MkdirAll, don't always keep trailing slash 2018-02-23 18:37:09 +00:00
path_test.go os: add support for long path names on unix RemoveAll 2018-10-31 13:55:01 +00:00
path_unix.go os: add support for long path names on unix RemoveAll 2018-10-31 13:55:01 +00:00
path_windows.go path: use OS-specific function in MkdirAll, don't always keep trailing slash 2018-02-23 18:37:09 +00:00
path_windows_test.go all: use strings.ReplaceAll and bytes.ReplaceAll where applicable 2018-09-26 22:14:25 +00:00
pipe2_bsd.go Revert "syscall, os: use pipe2 syscall on DragonflyBSD instead of pipe" 2018-08-26 21:30:35 +00:00
pipe_bsd.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
pipe_linux.go os: add deadline methods for File type 2017-10-25 18:27:06 +00:00
pipe_test.go os: increase default write size for TestClosedPipeRaceWrite 2018-12-04 03:32:16 +00:00
proc.go
rawconn.go os: add SyscallConn method for os.File 2018-12-27 16:36:34 +00:00
rawconn_test.go os: add SyscallConn method for os.File 2018-12-27 16:36:34 +00:00
removeall_at.go os: remove unreadable directories in RemoveAll 2019-03-04 20:01:35 +00:00
removeall_noat.go os: restore RemoveAll docs by making a single copy 2019-01-30 01:39:37 +00:00
removeall_test.go os: simplify check whether to run subtest of TestRemoveAll 2019-03-05 02:42:51 +00:00
stat.go os: don't use test logger for Getwd 2017-12-12 04:26:40 +00:00
stat_aix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
stat_darwin.go
stat_dragonfly.go
stat_freebsd.go syscall: revert to pre-FreeBSD 10 / POSIX-2008 timespec field names in Stat_t on FreeBSD 2018-12-30 19:36:52 +00:00
stat_linux.go
stat_nacljs.go os: add js/wasm architecture 2018-06-01 05:18:38 +00:00
stat_netbsd.go
stat_openbsd.go
stat_plan9.go os: fix TestDevNullFile on Plan 9 2018-03-27 05:30:50 +00:00
stat_solaris.go
stat_test.go os: use CreateFile for Stat of symlinks 2018-11-02 07:30:03 +00:00
stat_unix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
stat_windows.go all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
sticky_bsd.go os: fix tests for AIX 2018-10-26 14:46:35 +00:00
sticky_notbsd.go os: fix tests for AIX 2018-10-26 14:46:35 +00:00
str.go
sys.go
sys_aix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
sys_bsd.go os: add js/wasm architecture 2018-06-01 05:18:38 +00:00
sys_js.go os: add js/wasm architecture 2018-06-01 05:18:38 +00:00
sys_linux.go os: remove superfluous comments 2018-05-02 14:41:57 +00:00
sys_nacl.go
sys_plan9.go os: remove superfluous comments 2018-05-02 14:41:57 +00:00
sys_solaris.go
sys_unix.go os: add AIX operating system 2018-10-11 15:41:04 +00:00
sys_windows.go
timeout_test.go os: ignore SIGTTIN during TestTTYClose 2018-10-18 00:08:57 +00:00
types.go os: add ModeCharDevice to ModeType 2018-09-13 09:52:57 +00:00
types_plan9.go
types_unix.go
types_windows.go os: make Stat work on FAT file system 2018-12-17 09:34:04 +00:00
wait_unimp.go all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
wait_wait6.go all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00
wait_waitid.go all: use "reports whether" consistently instead of "returns whether" 2018-12-02 15:12:26 +00:00