我不认为我是唯一可能被这个困惑的人。使用build GO语言依赖关系
我有一个非常简单的Go程序,唯一的依赖是。
import (
"fmt"
"time"
)
我用“去打造myprogram.go”,并获得运行罚款二进制(因为我有GO安装)
但是,如果别人没有GO安装他们似乎得到错误。
例如:
open c:\go\lib\time\zoneinfo.zip: The system cannot find the path specified.
panic: time: missing Location in call to Time.In
什么我需要做的,包括在构建第三方库?
我想产生一个二进制文件可以在任何平台上运行,而不用担心依赖
的[是否有可能使用Go编译器来分发其它OS中的可执行文件?]可能的复制(http://stackoverflow.com/questions/13967470/is-it-possible-to-use-the-go-compiler-to-distribute-a-executable-file-for-other) –
你不需要去安装以运行Go二进制文件。查看关于zoneinfo.zip文件的[time.LoadLocation]文档(https://golang.org/pkg/time/#LoadLocation)文档。 – JimB