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

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

Protoc protoc-gen-go“時(shí)間戳”未定義

Protoc protoc-gen-go“時(shí)間戳”未定義

Go
函數(shù)式編程 2023-02-14 17:58:38
我需要使用 Protocol Buffers 序列化從 Google Drive drives:list 方法接收的 JSON 消息,并將它們寫入 BigQuery Storage Write API (GRPC)。這適用于除時(shí)間戳之外的所有字段類型。我終生無法生成包含時(shí)間戳的 go 類。首先,我正在關(guān)注此文檔,盡管我也嘗試了我可以在網(wǎng)上找到的所有內(nèi)容,包括在 stackoverflow 上的此處,但都無濟(jì)于事。在 MacOS 12.6 上,protoc 從此zip安裝到 /usr/local/bin,zip 中包含的內(nèi)容安裝到 /usr/local/include。這是我需要?jiǎng)?chuàng)建一個(gè)類的 drives.proto 文件:syntax = "proto3";option go_package = "./driveBuffers";import "google/protobuf/timestamp.proto";message Drive {  string id =1;  string name =2;  string colorRgb = 3;  string backgroundImageLink =4;  bool hidden = 5;  string orgUnitId = 6;  timestamp createdTime = 7;  message restrictions {    bool adminManagedRestrictions = 1;    bool domainUsersOnly = 2;    bool copyRequiresWriterPermission = 3;    bool driveMembersOnly = 4;  }}如果我刪除時(shí)間戳類型的字段,該工具會(huì)創(chuàng)建一個(gè)名為 ./driveBuffers/drives.pb.go 的文件。使用時(shí)間戳類型,會(huì)拋出這個(gè)錯(cuò)誤:% protoc --go_out=. -I ./ -I /usr/local/include/ drives.protodrives.proto:11:3: "timestamp" is not defined.
查看完整描述

1 回答

?
慕慕森

TA貢獻(xiàn)1856條經(jīng)驗(yàn) 獲得超17個(gè)贊

您應(yīng)該將該類型稱為google.protobuf.Timestamp. 例如:

  string orgUnitId = 6;
  google.protobuf.Timestamp createdTime = 7;


查看完整回答
反對 回復(fù) 2023-02-14
  • 1 回答
  • 0 關(guān)注
  • 201 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

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