jjzjj

go - 构建时在 golang 中找不到包 "github.com/user../../"

我正在尝试从github源代码构建一个项目。我发现一些源代码导入了如下所示的包:import("os""github.com/bivas/rivi/commands""github.com/mitchellh/cli")但是在构建项目时每次都会报错:user-MacBook-Pro:riviuser$gobuildrivi.gorivi.go:6:2:cannotfindpackage"github.com/bivas/rivi/commands"inanyof:/usr/local/Cellar/go/1.7.5/libexec/src/github.com/bivas/rivi/c

go - "Github.com"go 包未显示在 Bitbucket 的远程存储库中

当我将我的go代码推送到我的远程bitbucket存储库时,我没有在github.com包文件夹中看到我的文件,而是看到了这个(这是我的bitbucket存储库的屏幕截图,我希望在那里找到我的go文件):我使用此命令将我的代码推送到我的远程存储库:gitadd.gitcommit-m"message"gitpush-uoriginmaster当我登录到我的Bitbucket帐户时,我希望在“drakecheckin/src/github.com/coopernurse”目录中看到我的go文件。但是我没有看到我的go文件,而是看到一个指向一堆字符+数字的箭头。

go - Checkout.com 返回错误无效的付款货币

我正在研究Checkout.comAPIintegrationforgolang.我为Sofort和iDEAL等几个替代vendor选择了checkout.com。它们都有很好的文档:SofortiDEAL但是示例中的代码返回相同的错误curlhttps://sandbox.checkout.com/api2/v2/tokens/payment\-H"Authorization:sk_test_..."\-H"Content-Type:application/json"\-XPOST\-d'{"email":"test@email.com","value":1000,"currency

google-app-engine - 如何使用 github.com/golang/appengine 访问 Datastore?

我正在使用github.com/golang/appengine及其关联的“数据存储”。我希望这个包能让我在普通的Go网站中使用Datastore。不幸的是,我的c:=appengine.NewContext(rq)一直给我一个“NewContextpassedanunknownhttp.Request”错误。我的app.yaml包含application:sdklessdatastoremusicversion:1runtime:goapi_version:go1handlers:-url:/.*script:_go_appvm:truemanual_scaling:instance

go - 在任何一个中都找不到包 "github.com/gorrila/mux"

错误信息是:app.go:9:3:cannotfindpackage"github.com/gorrila/mux"inanyof:/usr/local/Cellar/go/1.10.3/libexec/src/github.com/gorrila/mux(from$GOROOT)/Users/myname/go/src/github.com/gorrila/mux(from$GOPATH)我知道GOROOT用于安装时附带的编译器工具,所以我不确定为什么它会在那里寻找mux。但是我在为go代码创建的目录的第二个位置确实看到了mux。我知道有人问过这个问题oncebefore我尝试按照该

即使文件存在,通过 github.com repo 的 Golang 本地导入也不起作用

我确实知道Go对于导入来说很古怪,但我已经尝试(我相信)遵循约定,但是我无法导入结构。项目结构:/project-name/parser/main.go/query/main.go...Projectfilesinroot我在/parser/main.go导出了一个结构:packageparsertypeSomeTranslationStuffstruct{IDint`json:"Id"`Languagestring`json:"Language"`}我希望在/query/main.go中导入它。我是这样做的:import("github.com/org/project-name/pa

http - google.com 的 golang 反向代理

我正在尝试使用golang的反向代理。我正在尝试在我的本地主机上创建一个反向代理,它将我的请求转发到google.com并返回响应。尽管这看起来很简单,但我无法获得正确的结果。我收到google404响应,说找不到url“/”我的代码packagemainimport("log""net/http""net/http/httputil""net/url")funcmain(){gogle,_:=url.Parse("http://www.google.com")proxy:=httputil.NewSingleHostReverseProxy(gogle)log.Fatal(http.

go - 如何使用 Ubuntu 更新 codeanywhere.com 上的 golang

如何使用Ubuntu14.04更新codeanywhere.com上的golang?默认容器使用Ubuntu存储库中的版本,而不是golangPPA。在撰写本文时,它是1.6,最新版本是1.9。 最佳答案 (还不能发表评论)只是一个附加信息,当您在空白容器上运行时,PawełPrażak的回答中的步骤有效。如果您在Go预定义堆栈上运行它们,它不会更新。我还建议将GOPATH值更改为您的工作区,运行exportGOPATH=$HOME/go然后运行​​goenv检查值是否正确更新。顺便感谢您的回答,Paweł!

postgresql - 非标准导入 github.com/lib/pq"in statdard package

这个问题在这里已经有了答案:golangwhatisimportsideeffect(1个回答)Whatdoesanunderscoreinfrontofanimportstatementmean?(5个答案)Importsideeffects(1个回答)关闭4年前。我一直遇到这个问题,我不明白为什么封装模型import("database/sql""fmt"_"github.com/lib/pq")const(host="localhost"port=5432user="postgres"password="postgres"dbname="postgres")vardb*sql.D

golang程序导入 "github.com/ethereum/go-ethereum/accounts/keystore"构建错误

请找到我的golang规范GOOS=linuxGOARCH=amd64gobuildgithub.com/ethereum/go-ethereum/crypto/secp256k1:buildconstraintsexcludeallGofilesin/Users/mac/Documents/project/src/github.com/ethereum/go-ethereum/crypto/secp256k1 最佳答案 使用CGO_ENABLED=1运行命令以在交叉编译时启用cgo的使用。CGO_ENABLED=1GOOS=lin