segevda
a241038823
replace ioutil usages with io and os ( #202 )
...
ioutil was deprecated in go1.16 and its functions now directly call io
and os functions. It is recommended to use these implementations in new
code.
2023-02-10 14:03:23 +01:00
Tobias Klauser
52a0828960
internal: remove redundant environment variable checks in ConfigDir
...
os.UserConfigDir will already check the AppData environment variable on
Windows (environment variable names are case-insensitive on Windows):
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=461-465
and the XDG_CONFIG_HOME environment variable on Unix operating systems:
https://cs.opensource.google/go/go/+/release-branch.go1.19:src/os/file.go;l=481-489
2023-01-31 14:45:20 +01:00
Tobias Klauser
8442404056
internal: inline getOSUserConfigDir
2022-06-27 09:52:46 +02:00
Tobias Klauser
14e2449428
internal: remove getOSUserConfigDir fallback for Go ≤ 1.13 ( #170 )
2022-06-24 05:13:01 -07:00
Tobias Klauser
f7e323ca2e
internal: use filepath.Join in PIDFile ( #114 )
...
Use filepath.Join to create a path with correct path delimiters on
Windows.
Based on a change by @42wim submitted in #107
2020-05-30 09:42:52 +02:00
Tobias Klauser
1e1db3f61d
internal: add gops subdirectory in ConfigDir ( #112 )
...
Use a subdirectory of the directory returned by os.UserConfigDir instead
of the UserConfigDir directly. This was missed in #103 . Also add a test.
Based on a change by @42wim submitted in #107
2020-05-30 09:40:59 +02:00
Tobias Klauser
ed67c5b345
Use os.UserConfigDir for internal.ConfigDir if available ( #103 )
...
On Go ≥ 1.13 the os package has os.ConfigDir
(https://golang.org/pkg/os/#UserConfigDir ) which returns the default
root directory to use for user-specific configuration data. Use this in
internal.ConfigDir if available, while still making sure that any
directory specified in GOPS_CONFIG_DIR takes precedence.
2020-05-14 22:01:34 +02:00
Jakub Łukasiewicz
71c4255d55
Check $XDG_CONFIG_HOME before falling to ~/.config ( #99 )
2020-02-29 14:24:56 -08:00
Rambone
dcc978d6e8
make ConfigDir configurable ( #61 )
...
make ConfigDir configurable
* internal: retrieve ConfigDir from GOPS_CONFIG_DIR environment variable
* make code graceful
* code optimize
2017-11-13 00:52:04 -07:00
JBD
25312cafb9
add missing license headers ( #54 )
2017-09-21 00:33:28 -06:00
Jaana Burcu Dogan
218c61a1d3
gops: Stat pidfile to determine if agent is working
...
Fixes #27 .
2017-01-19 18:37:32 -08:00
Jaana Burcu Dogan
c0c78ac94f
move config to internal
2016-11-14 23:07:31 -08:00