Skip to content

Commit

Permalink
goversion: use rsc.io/goversion/version instead of internal package (#47
Browse files Browse the repository at this point in the history
)

Follow up of
1128431#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.
  • Loading branch information
Emmanuel T Odeke authored and JBD committed Sep 4, 2017
1 parent bfd379c commit d858829
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 624 deletions.
9 changes: 6 additions & 3 deletions goprocess/gp.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import (
"os"
"sync"

goversion "rsc.io/goversion/version"

"github.com/google/gops/internal"
"github.com/google/gops/internal/goversion"
ps "github.com/keybase/go-ps"
)

Expand Down Expand Up @@ -95,11 +96,13 @@ func isGo(pr ps.Process) (path, version string, agent, ok bool, err error) {
if err != nil {
return
}
fi, err := os.Stat(path)
var versionInfo goversion.Version
versionInfo, err = goversion.ReadExe(path)
if err != nil {
return
}
version, ok = goversion.Report(path, path, fi)
ok = true
version = versionInfo.Release
pidfile, err := internal.PIDFile(pr.Pid())
if err == nil {
_, err := os.Stat(pidfile)
Expand Down
Loading

0 comments on commit d858829

Please sign in to comment.