我不明白为什么会这样:/
我用我找到的每一个网址都试过go get -u **。谢谢
Golang:
$ go version
go version go1.13.3 windows/amd64源码测试:
package main
import (
"fmt"
"cloud.google.com/go/datastore"
)
var client *datastore.Client
func main() {
fmt.Println("Work")
}错误:
$ go run main.go
# google.golang.org/grpc/internal/transport
..\..\..\..\google.golang.org\grpc\internal\transport\http_util.go:270:23: cannot use hf (type "vendor/golang.org/x/net/http2/hpack".HeaderField) as type
"golang.org/x/net/http2/hpack".HeaderField in argument to d.processHeaderField
..\..\..\..\google.golang.org\grpc\internal\transport\http_util.go:675:23: cannot use "golang.org/x/net/http2/hpack".NewDecoder(http2InitHeaderTableSize,
nil) (type *"golang.org/x/net/http2/hpack".Decoder) as type *"vendor/golang.org/x/net/http2/hpack".Decoder in assignment发布于 2019-10-26 04:38:52
Go要求您使用导入的任何包。在本例中,您导入了"cloud.google.com/go/datastore“,但没有对其执行任何操作。您声明的全局变量也未被使用。既然你看起来只是在试着测试,所以我建议你用它做点什么(至少打印出来)。就像-
package main
import (
"fmt"
"cloud.google.com/go/datastore"
)
var client *datastore.Client
func main() {
fmt.Println(client)
}https://stackoverflow.com/questions/58565020
复制相似问题