gpt4 book ai didi

go - 当我将 go mod 添加到我的项目时,无法运行它,我该如何解决?

转载 作者:行者123 更新时间:2023-12-01 22:17:30 25 4
gpt4 key购买 nike

我写了一个应用程序,当我将 go 模块添加到我的项目时 go mod init并尝试启动go run app.go我有一个错误:build command-line-arguments: cannot load github.com/nicksnyder/go-i18n/i18n: module github.com/nicksnyder/go-i18n@latest (v2.0.2+incompatible) found, but does not contain package github.com/nicksnyder/go-i18n/i18n .我能解决这个问题吗?

去.mod:


require (
github.com/BurntSushi/toml v0.3.1
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/dyatlov/go-opengraph v0.0.0-20180429202543-816b6608b3c8 // indirect
github.com/go-ldap/ldap v3.0.3+incompatible // indirect
github.com/gorilla/handlers v1.4.2
github.com/gorilla/mux v1.7.3
github.com/gorilla/websocket v1.4.1 // indirect
github.com/mattermost/mattermost-server v5.11.1+incompatible
github.com/pborman/uuid v1.2.0 // indirect
github.com/syndtr/goleveldb v1.0.0
go.uber.org/zap v1.12.0 // indirect
golang.org/x/crypto v0.0.0-20191029031824-8986dd9e96cf // indirect
gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
)

go.sum:
...
github.com/nicksnyder/go-i18n v2.0.2+incompatible
...

最佳答案

检查您是否正在导入正确的包。看起来该软件包已移至 github.com/nicksnyder/go-i18n/i18n/v2,因此请导入该软件包。

关于go - 当我将 go mod 添加到我的项目时,无法运行它,我该如何解决?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58647072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com