diff options
Diffstat (limited to 'vendor/github.com/google/gops')
-rw-r--r-- | vendor/github.com/google/gops/agent/agent.go | 3 | ||||
-rw-r--r-- | vendor/github.com/google/gops/internal/internal.go | 12 |
2 files changed, 2 insertions, 13 deletions
diff --git a/vendor/github.com/google/gops/agent/agent.go b/vendor/github.com/google/gops/agent/agent.go index de6d90f9..b7978069 100644 --- a/vendor/github.com/google/gops/agent/agent.go +++ b/vendor/github.com/google/gops/agent/agent.go @@ -12,7 +12,6 @@ import ( "encoding/binary" "fmt" "io" - "io/ioutil" "net" "os" gosignal "os/signal" @@ -115,7 +114,7 @@ func Listen(opts Options) error { } port := listener.Addr().(*net.TCPAddr).Port portfile = filepath.Join(gopsdir, strconv.Itoa(os.Getpid())) - err = ioutil.WriteFile(portfile, []byte(strconv.Itoa(port)), os.ModePerm) + err = os.WriteFile(portfile, []byte(strconv.Itoa(port)), os.ModePerm) if err != nil { return err } diff --git a/vendor/github.com/google/gops/internal/internal.go b/vendor/github.com/google/gops/internal/internal.go index 7fc162a6..7e3492aa 100644 --- a/vendor/github.com/google/gops/internal/internal.go +++ b/vendor/github.com/google/gops/internal/internal.go @@ -6,11 +6,9 @@ package internal import ( "errors" - "io/ioutil" "os" "os/user" "path/filepath" - "runtime" "strconv" "strings" ) @@ -26,14 +24,6 @@ func ConfigDir() (string, error) { return filepath.Join(userConfigDir, "gops"), nil } - if runtime.GOOS == "windows" { - return filepath.Join(os.Getenv("APPDATA"), "gops"), nil - } - - if xdgConfigDir := os.Getenv("XDG_CONFIG_HOME"); xdgConfigDir != "" { - return filepath.Join(xdgConfigDir, "gops"), nil - } - homeDir := guessUnixHomeDir() if homeDir == "" { return "", errors.New("unable to get current user home directory: os/user lookup failed; $HOME is empty") @@ -62,7 +52,7 @@ func GetPort(pid int) (string, error) { if err != nil { return "", err } - b, err := ioutil.ReadFile(portfile) + b, err := os.ReadFile(portfile) if err != nil { return "", err } |