diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-08-26 08:15:20 +0000 |
commit | 87d772a7d708fec12f48cd8adc0dedff6e1025da (patch) | |
tree | 1fee344c64cc3f43074a01981e21126c8482a522 /src/go/collectors/go.d.plugin/agent/executable/executable.go | |
parent | Adding upstream version 1.46.3. (diff) | |
download | netdata-87d772a7d708fec12f48cd8adc0dedff6e1025da.tar.xz netdata-87d772a7d708fec12f48cd8adc0dedff6e1025da.zip |
Adding upstream version 1.47.0.upstream/1.47.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/go/collectors/go.d.plugin/agent/executable/executable.go')
-rw-r--r-- | src/go/collectors/go.d.plugin/agent/executable/executable.go | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/go/collectors/go.d.plugin/agent/executable/executable.go b/src/go/collectors/go.d.plugin/agent/executable/executable.go deleted file mode 100644 index cb09db1eb..000000000 --- a/src/go/collectors/go.d.plugin/agent/executable/executable.go +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: GPL-3.0-or-later - -package executable - -import ( - "os" - "path/filepath" - "strings" -) - -var ( - Name string - Directory string -) - -func init() { - path, err := os.Executable() - if err != nil || path == "" { - Name = "go.d" - return - } - - _, Name = filepath.Split(path) - Name = strings.TrimSuffix(Name, ".plugin") - - if strings.HasSuffix(Name, ".test") { - Name = "test" - } - - // FIXME: can't use logger because of circular import - fi, err := os.Lstat(path) - if err != nil { - return - } - - if fi.Mode()&os.ModeSymlink != 0 { - realPath, err := filepath.EvalSymlinks(path) - if err != nil { - return - } - Directory = filepath.Dir(realPath) - } else { - Directory = filepath.Dir(path) - } -} |