dongniaoli1822 2016-12-01 16:08
浏览 32
已采纳

谷歌云BigQuery未定义ValueList

I'm working with the BigQuery API on Google Cloud Platform and I've completed the Golang client library installation.

When I try to compile, I see the following errors:

[root@server ~]$ go install github.com/user/program
# github.com/user/program/handler
go/src/github.com/user/program/handler/file1.go:228: undefined:
"cloud.google.com/go/bigquery".ValueList
go/src/github.com/user/program/handler/file1.go:259: undefined: 
"cloud.google.com/go/bigquery".ValueList

The offending line for 228 is:

227 for {
228     var values bigquery.ValueList
229     err := it.Next(&values)

At the top of the file I import the package, as normally

import "cloud.google.com/go/bigquery"

and have taken care to install the client library for Golang https://cloud.google.com/bigquery/docs/reference/libraries#client-libraries-install-go

I can see that the cloud.google.com package is contained within my GOPATH and I see the ValueList type decleration inside of a file in there. It is therefore puzzling that I'm getting this error.

What's more: I can compile this fine on my Windows machine with no errors. It's only when I try to do the same thing on my CentOS VM that I run into this. Both are running go version go1.6.3.

Thank you.

  • 写回答

1条回答 默认 最新

  • dongyuan2388 2016-12-01 17:41
    关注

    @Spikey,

    Hi, please make sure you've installed correct client. Here's why:

    1. After installing go get -u cloud.google.com/go/bigquery I see that they do not have an exported ValueList type(!). Only valuelist, i.e. unexported. Check line 39 of ~go/src/google.golang.org/cloud/bigquery/value.go

    2. However, they do mention ValueList as an exported type in their docs(!), for example:

    3. Also, ValueList is an exported type if looking directly at: https://github.com/GoogleCloudPlatform/google-cloud-go/blob/master/bigquery/value.go

    So there's a confusion about installing a correct Google client.

    Hope this helps!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上