我认为这是传统的 *** 作方式,我认为它可以在任何平台上使用。
import ( "fmt" "os" "path/filepath")// Shortcut to get the path to the current executablefunc ExecPath() string { var here = os.Args[0] here, err := filepath.Abs(here) if err != nil { fmt.Printf("Weird path: %sn", err) } return here}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)