我编写了一个应用程序,当我将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
。我该怎么办?
go.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
...