1
0
mirror of https://github.com/google/gops.git synced 2024-11-19 20:31:58 +02:00
Commit Graph

25 Commits

Author SHA1 Message Date
Mahe Tardy
ac7253a173 Fix process command crash when provided with no args
Use cobra.MinimumNArgs to require at least one argument and handle
errors in processing the arguments. Improve the use help string.
2023-08-09 11:50:58 +02:00
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
segevda
dbeb29cd3e
cmd/shared: add 'off' option to setgc (#201)
To stop GC completely, debug.SetGCPercentage needs to receive a negative
integer. Passing a negative integer is cumbersome:
$ gops setgc <pid> -- -1

This commit adds a more user-friendly way to achieve that:
$ gops setgc <pid> off

This behavior is aligned with that of the GOGC env variable, where
negative or "off" can be set to stop the GC.
2023-02-10 11:24:10 +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
Glib Smaga
9069aa4d19 Migrate gops to use spf13/cobra for command execution
Manual command setup was starting to show some strain in
terms of documentation and also adding new features
(regardless of what the protocol supports currently).

This new setup aims to make it easier to add new
documentation and functionality.

In comparison to the previous version, this increased the
binary size by 2.4M.
```
6.4M gops
4.0M gops_master
```
2022-08-30 14:31:29 +02:00
Glib Smaga
024cce5849 internal/cmd: Move code here from the main package 2022-08-30 14:31:29 +02: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
a22894be16 Add //go:build tags for Go 1.17
Run Go 1.17 gofmt to add //go:build tags.
2021-09-03 09:57:33 +02: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
JBD
d38055cdcb internal, vendor: remove unused code (#48)
internal object packages are no longer required
given gops depends on rsc.io/goversion/version now.

Also running dep prune to remove the packages
gops doesn't depend from the vendor directory.
2017-09-06 12:15:36 -06:00
Emmanuel T Odeke
d858829db9 goversion: use rsc.io/goversion/version instead of internal package (#47)
Follow up of
112843115d (commitcomment-23936637)

Solves the problem of us having to manually watch
upstream and pull in bug fixes and updates, if our
internal copy goes stale.

Fixes #22.
2017-09-04 11:53:45 -07:00
Jaana Burcu Dogan
112843115d report go build version 2017-08-26 14:47:02 -07: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
Jaana Burcu Dogan
fa859543ad add TODO 2016-11-11 15:41:29 -08:00
Jaana Burcu Dogan
abbbf18aa2 internal: disable goobj
Fixes #2.
2016-11-11 14:24:41 -08:00
Jaana Burcu Dogan
5d86652de7 remove the test that required internal/testenv 2016-11-11 13:36:48 -08:00
Jaana Burcu Dogan
29b45c622d move to github.com/google, fix the build 2016-11-05 13:03:31 -07:00
Jaana Burcu Dogan
6d6995e5c3 initial commit 2016-11-03 14:01:55 -07:00