我目前正在开发一个可以构建为 Windows 服务或作为 OSX/linux 可执行文件运行的服务。
我在 Windows 文件上使用构建标记,包括带有主要方法的标记
// +build windows
而在另一个包含主要方法的文件上
// +build !windows
当我go run *.go在mac端执行时,出现以下错误
mainDOS.go:10:2: no buildable Go source files in /Users/michaelbrandenburg/Documents/git-repo/goCode/src/golang.org/x/sys/windows/svc
windowsService.go:15:2: no buildable Go source files in /Users/michaelbrandenburg/Documents/git-repo/goCode/src/golang.org/x/sys/windows/svc/debug
install.go:14:2: no buildable Go source files in /Users/michaelbrandenburg/Documents/git-repo/goCode/src/golang.org/x/sys/windows/svc/eventlog
install.go:15:2: no buildable Go source files in /Users/michaelbrandenburg/Documents/git-repo/goCode/src/golang.org/x/sys/windows/svc/mgr
有没有办法运行go run和定位我想要运行的架构?我可以毫无问题地构建可执行文件。
万千封印
相关分类