英文:
error when running golang code, regex package is missing?
问题
我正在尝试运行我编写的一些 Go(golang)代码,但一直出现以下错误:
在任何位置都找不到“regex”包:
/usr/local/go/src/pkg/regex(来自$GOROOT)
/gopath/src/regex(来自$GOPATH)
安装 Go 时不包含 regex 吗?
如果不包含,我应该在哪里找到它并如何安装?
英文:
I'm trying to run some go (golang) code I have written and I keep on getting this error:
cannot find package "regex" in any of:
/usr/local/go/src/pkg/regex (from $GOROOT)
/gopath/src/regex (from $GOPATH)
Isn't regex included when one installs Go?
If not, where I can I find it and how can I install it?
答案1
得分: 8
这被称为regexp
,而不是regex
:http://golang.org/pkg/regexp/
英文:
It's called regexp
, not regex
: http://golang.org/pkg/regexp/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论