// return fullpath to executable file.
return fullpath to executable file.
// return fullpath to executable file .
func absExePath(exe string) (name string, err error) {
	name = exe
	if name[0] == '.' {
		name, err = filepath.Abs(name)
		if err != nil {
			name = filepath.Clean(name)
		}
	} else {
		name, err = exec.LookPath(filepath.Clean(name))
	}
	if err != nil {
		return
	}
	fileinfo, err := os.Lstat(name)
	if err != nil {
		return
	}
	if fileinfo.Mode()&os.ModeSymlink != 0 {
		name, err = os.Readlink(name)
	}
	return
}
func absExePath ( exe string ) ( name string , err error ) { name = exe if name [ 0 ] == '.' { name , err = filepath . Abs ( name ) if err != nil { name = filepath . Clean ( name ) } } else { name , err = exec . LookPath ( filepath . Clean ( name ) ) } if err != nil { return } fileinfo , err := os . Lstat ( name ) if err != nil { return } if fileinfo . Mode ( ) & os . ModeSymlink != 0 { name , err = os . Readlink ( name ) } return }
return fullpath to executable file.
return fullpath to executable file .
// follow symlink