mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven -copy -rewrite $i; done
26 lines
553 B
Go
26 lines
553 B
Go
// Copyright 2012 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build linux netbsd openbsd
|
|
|
|
package osext
|
|
|
|
import (
|
|
"errors"
|
|
"os"
|
|
"runtime"
|
|
)
|
|
|
|
func executable() (string, error) {
|
|
switch runtime.GOOS {
|
|
case "linux":
|
|
return os.Readlink("/proc/self/exe")
|
|
case "netbsd":
|
|
return os.Readlink("/proc/curproc/exe")
|
|
case "openbsd":
|
|
return os.Readlink("/proc/curproc/file")
|
|
}
|
|
return "", errors.New("ExecPath not implemented for " + runtime.GOOS)
|
|
}
|