草庐IT

oval2Path

全部标签

go - "go get google.golang.org/grpc"失败 : unrecognized import path

因此,我尝试使用“goget”在我的Raspberry3/Raspbian系统上安装我的Go应用程序的依赖项,并在尝试为Go安装gRPC时遇到以下问题:[pi@raspberrypi-1camera-service]17:32:28%gogetgoogle.golang.org/grpcpackagegoogle.golang.org/grpc:unrecognizedimportpath"google.golang.org/grpc"(httpsfetch:Gethttps://google.golang.org/grpc?go-get=1:dialtcp:lookupgoogle.

go - 无法在 MacOS 上安装 Revel "package gopkg.in/fsnotify.v1: unrecognized import path"

按照“GettingStarted”方向:$goget-vgithub.com/revel/revelFetchinghttps://gopkg.in/fsnotify.v1?go-get=1Parsingmetatagsfromhttps://gopkg.in/fsnotify.v1?go-get=1(statuscode404)packagegopkg.in/fsnotify.v1:unrecognizedimportpath"gopkg.in/fsnotify.v1"(parsehttps://gopkg.in/fsnotify.v1?go-get=1:nogo-importme

docker - 包 X 无法识别的导入路径 : import path does not begin with hostname

在我的Golang/gin项目中,我有一个dockerfile。这个docker文件看起来像这样FROMgolang:latestRUNmkdir-p/go/src/myAppNameADD./go/src/myAppNameWORKDIR/go/src/myAppNameENVGOPATH/goENVPATH$GOPATH/bin:/usr/local/go/bin:$PATHRUNgoget-d-v./...RUNgoinstall-v./...RUNgogetgithub.com/pilu/freshEXPOSE8080CMD["fresh"]当我运行命令dockerbuild时

postgresql - 执行 : "sqlboiler": executable file not found in $PATH

安装后SqlBoiler.将简单代码复制粘贴到main.go中,执行postgresql创建数据库。我通过以下方式生成了Go模型:gogenerate我遇到了一个错误:running"sqlboiler":exec:"sqlboiler":executablefilenotfoundin$PATH我看过SQLBoilerScreencast但假设用户预先配置了SqlBoiler我错过了什么? 最佳答案 screencast开始于goget-u-tgithub.com/vattle/sqlboiler仅此一步就应该在您的$GOPATH

go - 在 $PATH 中查找二进制文件

我正在寻找一个函数来在$PATH中可用的所有文件夹中查找二进制文件。我知道我可以使用os.Getenv("PATH")但它返回:path:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/go/bin哪些需要处理。理想情况下函数如下:FindBinary("ntpq")它将返回路径+二进制名称,如果在路径中找不到则返回false。有人有现成的功能吗? 最佳答案 您可以使用LookPathos/exec包中的函数:path,err:=exec.Loo

Go get path 是 GOROOT,而不是 GOPATH 错误,即使在 Windows 中设置了 env

在Windows8中,每当我尝试使用goget和goinstall下载包时,我都会收到以下错误:cannotdownload,C:\Users\MYUSER\goisaGOROOT,notaGOPATH.Formoredetailssee:'gohelpgopath'我为计算机和当前用户手动设置了环境变量GOPATH、GOROOT和GOTOOLDIR,但无济于事用户去环境setGOARCH=amd64setGOBIN=setGOEXE=.exesetGOHOSTARCH=amd64setGOHOSTOS=windowssetGOOS=windowssetGOPATH=C:\Users\

Golang 构建 : get 'Syntax error: newline unexpected' when executing executable from specific path

我的应用打包如下:|-cmd/|-cmd/application/并且当从根/运行以下命令时:gobuildcmd/application/*.go它生成一个运行良好的可执行文件。但是当从/cmd/application中输入以下命令时:gobuildmy_app_custom_name我收到Syntaxerror:newlineunexpected错误,就好像它不再是bash可执行文件一样。 最佳答案 在使用标志-v和-x之后,在指示@Volker的帮助下,我发现我将包命名为“myapp”,而不是应有的“main”。现在它工作得很

docker - 无法安装 golint 包 : wrong import path

我有一个项目使用golint并将其安装在docker容器中。它几个月来一直工作正常(并且已经构建了多次),但是今天当我再次构建容器时,我收到以下错误:去获取-ugithub.com/golang/lint/golintpackagegithub.com/golang/lint/golint:codeindirectory/a-go-path/golang/lint/golintexpectsimport"golang.org/x/lint/golint"我可以通过键入gogetgithub.com/golang/lint/golint在我的计算机上本地复制问题。我已经删除了go路径(s

go - : first path segment in URL cannot contain colon

这是我的代码(部分):typeSitemapIndexstruct{//Locations[]Location`xml:"sitemap"`Locations[]string`xml:"sitemap>loc"`}~~~SNIP~~~funcmain(){varsSitemapIndexresp,_:=http.Get("https://www.washingtonpost.com/news-sitemaps/index.xml")bytes,_:=ioutil.ReadAll(resp.Body)xml.Unmarshal(bytes,&s)for_,Location:=ranges

bash - 在 PATH 中转到 bin,但 "go version"失败

如何使用bash中的标准安装说明来使用go?我做错了什么?我关注了installationinstructionsforgoonLinux.因此,我下载了gotar.gz,将其解压缩到/usr/local并将exportPATH=$PATH:/usr/local/go/bin添加到/etc/bash.bashrc并创建了一个source/etc/bash.bashrc。但是,goversion没有给出正确的结果。参见:user@machine:~$whichgo/usr/local/go/bin/gouser@machine:~$goversionuser@machine:~$/usr