运行golang代码时出现错误,缺少regex包?

huangapple go评论93阅读模式
英文:

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/

huangapple
  • 本文由 发表于 2014年4月15日 04:39:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/23069975.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定