3 Star 1 Fork 0

Gitee 极速下载 / gocode

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/nsf/gocode
克隆/下载
os_posix.go 863 Bytes
一键复制 编辑 原始数据 按行查看 历史
// +build !windows
package main
import (
"flag"
"os"
"os/exec"
"path/filepath"
)
func create_sock_flag(name, desc string) *string {
return flag.String(name, "unix", desc)
}
// Full path of the current executable
func get_executable_filename() string {
// try readlink first
path, err := os.Readlink("/proc/self/exe")
if err == nil {
return path
}
// use argv[0]
path = os.Args[0]
if !filepath.IsAbs(path) {
cwd, _ := os.Getwd()
path = filepath.Join(cwd, path)
}
if file_exists(path) {
return path
}
// Fallback : use "gocode" and assume we are in the PATH...
path, err = exec.LookPath("gocode")
if err == nil {
return path
}
return ""
}
// config location
func config_dir() string {
return filepath.Join(xdg_home_dir(), "gocode")
}
func config_file() string {
return filepath.Join(xdg_home_dir(), "gocode", "config.json")
}
1
https://gitee.com/mirrors/gocode.git
git@gitee.com:mirrors/gocode.git
mirrors
gocode
gocode
b672b49f3818

搜索帮助