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 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么