无法加载github.com/open-policy-agent/opa/capabilities: no Go源文件

dsekswqp  于 2023-06-27  发布在  Go
关注(0)|答案(1)|浏览(83)

我尝试使用命令go get github.com/open-policy-agent/opa/rego安装OPA库
但是安装遇到了消息

build github.com/open-policy-agent/opa/capabilities: cannot load github.com/open-policy-agent/opa/capabilities: no Go source files

下面是命令的o/p:

-bash-4.2$ go get github.com/open-policy-agent/opa/rego
go: finding github.com/open-policy-agent/opa/rego latest
go: finding github.com/open-policy-agent/opa v0.53.1
go: downloading github.com/open-policy-agent/opa v0.53.1
go: extracting github.com/open-policy-agent/opa v0.53.1
go: downloading github.com/gorilla/mux v1.8.0
go: downloading github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
go: downloading github.com/sirupsen/logrus v1.9.2
go: downloading github.com/go-ini/ini v1.67.0
go: downloading go.opentelemetry.io/otel v1.14.0
go: extracting github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0
go: downloading github.com/prometheus/client_golang v1.15.1
go: downloading github.com/OneOfOne/xxhash v1.2.8
go: downloading gopkg.in/yaml.v2 v2.4.0
go: downloading github.com/gobwas/glob v0.2.3
go: extracting github.com/gorilla/mux v1.8.0
go: downloading github.com/tchap/go-patricia v2.2.6+incompatible
go: extracting github.com/prometheus/client_golang v1.15.1
go: extracting gopkg.in/yaml.v2 v2.4.0
go: extracting github.com/sirupsen/logrus v1.9.2
go: extracting github.com/OneOfOne/xxhash v1.2.8
go: extracting go.opentelemetry.io/otel v1.14.0
go: extracting github.com/tchap/go-patricia v2.2.6+incompatible
go: extracting github.com/go-ini/ini v1.67.0
go: downloading github.com/yashtewari/glob-intersection v0.1.0
go: downloading github.com/tchap/go-patricia/v2 v2.3.1
go: downloading github.com/ghodss/yaml v1.0.0
go: downloading github.com/agnivade/levenshtein v1.1.1
go: extracting github.com/tchap/go-patricia/v2 v2.3.1
go: downloading github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: extracting github.com/yashtewari/glob-intersection v0.1.0
go: extracting github.com/ghodss/yaml v1.0.0
go: extracting github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
go: extracting github.com/gobwas/glob v0.2.3
go: downloading github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
go: downloading golang.org/x/sys v0.8.0
go: extracting github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb
go: extracting golang.org/x/sys v0.8.0
go: downloading google.golang.org/protobuf v1.30.0
go: downloading github.com/prometheus/client_model v0.3.0
go: downloading github.com/prometheus/common v0.42.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash v1.1.0
go: extracting github.com/agnivade/levenshtein v1.1.1
go: extracting github.com/prometheus/common v0.42.0
go: extracting github.com/beorn7/perks v1.0.1
go: extracting github.com/prometheus/client_model v0.3.0
go: extracting github.com/cespare/xxhash v1.1.0
go: downloading github.com/prometheus/procfs v0.9.0
go: downloading github.com/cespare/xxhash/v2 v2.2.0
go: extracting google.golang.org/protobuf v1.30.0
go: downloading github.com/golang/protobuf v1.5.3
go: extracting github.com/cespare/xxhash/v2 v2.2.0
go: extracting github.com/golang/protobuf v1.5.3
go: extracting github.com/prometheus/procfs v0.9.0
go: downloading go.opentelemetry.io/otel/sdk v1.14.0
go: extracting go.opentelemetry.io/otel/sdk v1.14.0
go: downloading github.com/go-logr/logr v1.2.4
go: extracting github.com/go-logr/logr v1.2.4
go: downloading github.com/go-logr/stdr v1.2.2
go: extracting github.com/go-logr/stdr v1.2.2
go: downloading github.com/matttproud/golang_protobuf_extensions v1.0.4
go: extracting github.com/matttproud/golang_protobuf_extensions v1.0.4
go: downloading go.opentelemetry.io/otel/trace v1.14.0
go: extracting go.opentelemetry.io/otel/trace v1.14.0
go: finding github.com/OneOfOne/xxhash v1.2.8
build github.com/open-policy-agent/opa/capabilities: cannot load github.com/open-policy-agent/opa/capabilities: no Go source files

在安装OPA之前,是否有任何先决条件?还是我在安装过程中遗漏了什么?

-bash-4.2$ uname -a
Linux dev-rh72-tas-1.in.intinfra.com 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux
kxeu7u2r

kxeu7u2r1#

你的Go版本已经过时好几年了。Opa至少需要Go 1.16

相关问题