第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

使用 Google Cloud go 庫進行日志記錄時遇到的問題

使用 Google Cloud go 庫進行日志記錄時遇到的問題

Go
偶然的你 2022-08-01 15:14:16
我正在嘗試與此處找到的Go示例代碼一起使用:https://cloud.google.com/logging/docs/reference/libraries#using_the_client_library。在go1.15.6中,我嘗試了以下方法:import "cloud.google.com/go/logging"$ go get -u cloud.google.com/go/logging# many errors about dependencies, so$ go get -u github.com/google/go-cmp/cmp$ go get -u golang.org/x/sync/semaphore# then I can get through this one$ go get -u cloud.google.com/go/logging# for further amusement, these two fail with what seems to be a compiler error$ go get cloud.google.com/go/storage$ go get cloud.google.com/go/iam# Then trying to build my code using Logging:$ go build -i -vcloud.google.com/go/logging/apiv2# cloud.google.com/go/logging/apiv2../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:269:62: undefined: logging.ListBucketsRequest../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:310:60: undefined: logging.GetBucketRequest../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:310:114: undefined: logging.LogBucket../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:328:63: undefined: logging.CreateBucketRequest../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:328:120: undefined: logging.LogBucket../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:354:63: undefined: logging.UpdateBucketRequest../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:354:120: undefined: logging.LogBucket../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:374:63: undefined: logging.DeleteBucketRequest../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:825:14: undefined: logging.LogBucket../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:840:65: undefined: logging.LogBucket../../go/src/cloud.google.com/go/logging/apiv2/config_client.go:374:63: too many errors```
查看完整描述

1 回答

?
繁華開滿天機

TA貢獻1816條經驗 獲得超4個贊

在這個問題上提供了評論 安裝GCP go庫進行日志記錄的問題(被不想嘗試幫助的人粗魯?shù)仃P閉了),這指向了這個答案的方向。


這里的問題是你沒有使用模塊,谷歌云庫只支持使用這種方式。這意味著您根本不使用,盡管 https://cloud.google.com/logging/docs/reference/libraries#client-libraries-install-go 上的文檔。相反,請先創(chuàng)建以下 go.mod 文件:go get ...


module example.com/mymod


go 1.15


require (

    cloud.google.com/go/logging v1.1.2

)

然后,運行它將安裝所有必需的模塊。go build -i -v


查看完整回答
反對 回復 2022-08-01
  • 1 回答
  • 0 關注
  • 116 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號