草庐IT

find_module

全部标签

go - 在 buffalo 中生成新项目失败,出现 GO111MODULE 问题

我是第一次尝试buffalo。我手动安装了先决条件而不是使用scoop,因为我不知道scoop会把东西放在哪里:https://www.stuartellis.name/articles/windows-golang-setup/#installing-buffalo使用Powershell中的这个安装了buffalo,它似乎工作正常:goget-u-vgithub.com/gobuffalo/buffalo/buffalo然而,当我使用这个例子生成一个新项目时:https://gobuffalo.io/en/docs/getting-started/new-project/buffa

go - 构建命令行参数 : cannot load local package: cannot find module providing package

我无法使用gomod加载本地包。我有单独的go.mod文件用于repoA和repoB。我在任何地方都找不到解决方案。操作系统是windows。$>goversiongoversiongo1.12.7windows/amd64当我从repoA运行主文件时,我有两个带有存储库的模块。它将尝试查找repoB的模块/包,然后抛出一个错误提示cannotfindmoduleprovidingpackage我的repo结构:-����repoA�����proto������system�����sauth�����shandle�����smodel�����sresponse����repoB

go - 使用 GO111MODULE 安装 buffalo 导致 go get : error loading module requirements

这个问题在这里已经有了答案:GO111MODULE=on(errorloadingmodulerequirements)(1个回答)关闭3年前。我在尝试安装buffalo时遇到错误。我在goversiongo1.12.7linux/amd64上使用干净的GOPATH进行了测试,其中没有任何内容。GO111MODULE设置为on。我尝试使用网站上给出的命令安装buffalo:goget-u-vgithub.com/gobuffalo/buffalo/buffalo执行命令导致返回代码1,详细输出末尾的错误消息似乎是goget:errorloadingmodulerequirements。

由于 : "go directory outside available modules",Docker 构建失败

我在构建我的go服务的Docker镜像时遇到问题(请参阅最后的错误消息)。我的服务代码结构如下:cmd-duc-adobepkg-adobe-common.gitignoreDockerfilego.modgo.sum这是我的Dockerfile:#buildimageFROMgolang:1.12-alpineasbuilderRUNapkupdate&&apkadd--no-cachegitca-certificates&&update-ca-certificatesWORKDIR/app#firstdownloaddependenciessothatwecanutilizethe

bash - 运行使用 OpenVINO 和 OpenCV 的 Go 程序 -/usr/bin/ld : cannot find -lXXX

我正在尝试用Go编程语言编写一个程序,该程序使用OpenVINODNN模型来执行推理。为此,我遵循了此GITHUB链接中的说明:https://github.com/hybridgroup/gocv/tree/master/openvino我已经安装了OpenVINO和与之配套的第3方库,其中包括位于~/intel/openvino_{version}/opencv目录中的OpenCV。事情是每当我尝试执行以下命令时:gorun-tagsopenvino./cmd/version/main.go我得到这个输出:runtime/cgo/usr/bin/ld:cannotfind-lHet

GoMobile 版本 : Cannot find package

我在Go[1.12.9windows/amd64]中测试GoMobile工具,并尝试将其附带的示例项目构建到AndroidApk中。在将构建指向package目录并运行构建命令时,控制台给出了一个找不到包错误。Go包如何识别?[注意-我尝试安装和使用GoMobiletools,但它们也没有被识别,我只能通过VSCode将它们下载为Git包]PSD:\Script\Golang\bin>goversiongoversiongo1.12.9windows/amd64PSD:\Script\Golang\src\golang.org\x\mobile\example\basic>gciDir

go - 如何修复 gomod : `github.com/stretchrcom/testify@v1.4.0: parsing go.mod: unexpected module path "github. com/strethr/testify"`

当我执行gomodtidy时。我收到以下错误:go:github.com/stretchrcom/testify@v1.4.0:parsinggo.mod:unexpectedmodulepath"github.com/stretchr/testify" 最佳答案 此错误是由于在将testify移动到github.com/stretchr/testify之前引用testify的包造成的。解决方案是在您的go.mod中添加以下行:替换github.com/stretchrcom/testifyv1.4.0=>github.com/st

amazon-web-services - "MissingRegion": could not find region configuration, 但我在 ~/.aws.config 中有它

我的代码:sess=session.Must(session.NewSessionWithOptions(session.Options{Profile:"gms-ai",}))我的~/.aws/config:[default]output=jsonregion=us-east-1[profilegms-ai]output=jsonregion=us-east-2但是例如,这是我的部署脚本中的工作片段:AWS_PROFILE=gms-ai\awslambdaupdate-function-code...看起来awscli确实读取了region但AWSSDK忽略了它?

go - 多路复用器去 :12: can't find import: "github.com/gorilla/context"`

我正在尝试安装我的Go测试包,但我一直收到此错误:D:\Developpement\golang\src\github.com\gorilla\mux\mux.go:12:找不到导入:“github.com/gorilla/context”这是我的代码:packagemainimport("github.com/gorilla/pat""net/http")funcmain(){mux:=pat.New()mux.Get("/user/:name/profile",http.HandlerFunc(profile))http.Handle("/",mux)log.Println("Li

mongodb - mgo collection.Find(nil).All(&users) 不工作

我有下一个问题..我无法从我的mongo数据库(在docker容器中运行)中获取所有记录,这是我非常简单的代码:typeUserstruct{Emailstring`json:"email"bson:"email"`Passstring`json:"pass"bson:"pass"`}session:=dbConnect()collection:=session.DB("my_db").C("users")varusers[]Usererr:=collection.Find(nil).All(&users)iferr!=nil{log.Fatal("Mongocollectionfin