Jason Lee
  • Home
  • Github
Sign in Subscribe

go

A collection of 1 post
go

Golang ProtocolBuffer 如何自訂 json tag

介紹 目前用官方的 ProtocolBuffer 產生器會遇到一個問題,就是工具產生的 Go Code 不是我們自己想要的格式,例如 FirstName 屬性,我們想要的是 first_name,今天我們帥氣的實習生推薦一個工具來解決這個問題 https://github.com/gogo/protobuf 安裝 除了原本的 protoc, 還需要特別安裝下面套件 go get github.com/gogo/protobuf/proto go get github.com/gogo/protobuf/jsonpb go get github.com/gogo/protobuf/protoc-gen-gogo go get github.com/gogo/
Jan 24, 2019 1 min read
Page 1 of 1
Jason Lee © 2025
Powered by Ghost