mitchellh / panicwrap

panicwrap is a Go library for catching and handling panics in Go applications.
https://gist.github.com/mitchellh/90029601268e59a29e64e55bab1c5bdc
MIT License
443 stars 69 forks source link

"kardianos/osext" is obsolete on go-1.8+ #22

Closed onlyjob closed 5 years ago

onlyjob commented 6 years ago

The following patch allows to remove redundant github.com/kardianos/osext dependency:

--- a/panicwrap.go
+++ b/panicwrap.go
@@ -20,9 +20,8 @@
        "sync/atomic"
        "syscall"
        "time"

-       "github.com/kardianos/osext"
 )

 const (
        DEFAULT_COOKIE_KEY = "cccf35992f8f3cd8d1d28f0109dd953e26664531"
@@ -117,9 +116,9 @@
                return -1, nil
        }

        // Get the path to our current executable
-       exePath, err := osext.Executable()
+       exePath, err := os.Executable()
        if err != nil {
                return -1, err
        }
maxp-edcast commented 5 years ago

I would implore the package owners here to please remove this dependency. I get this error:

vendor/github.com/bugsnag/panicwrap/monitor.go:6:2: cannot find package "github.com/kardianos/osext" in any of:
    /Users/max/go/src/echo_influx_interface/vendor/github.com/kardianos/osext (vendor tree)
    /usr/local/Cellar/go/1.11/libexec/src/github.com/kardianos/osext (from $GOROOT)
    /Users/max/go/src/github.com/kardianos/osext (from $GOPATH)
2018/11/21 15:15:38 exit status 1