首页 > 其他分享 >mac 下Golang 安装Protobuf

mac 下Golang 安装Protobuf

时间:2023-06-13 15:04:26浏览次数:36  
标签:golang protoc Protobuf get Golang mac github go protobuf


1、安装protobuf

brew install protobuf

2、检查安装结果

protoc  --version

3、安装golang for protobuf插件

go get github.com/golang/protobuf/protoc-gen-go
go get -u -v github.com/golang/protobuf/protoc-gen-go

go get = git clone + go install
这里会慢的要死
所以我这里采取的是先直接在github 上面去下载下来,复制到

/src/github.com/golang/

目录下,分别进入到 protobuf/proto 和 protobuf/protoc-gen-go/ 目录下执行

go build
go install

命令

4、运用,在文件目录里运行

protoc --go_out=plugins=grpc:. user.proto

生成了新文件,成功


标签:golang,protoc,Protobuf,get,Golang,mac,github,go,protobuf
From: https://blog.51cto.com/u_16159391/6470212

相关文章

  • Mac软件安装
    文章目录一、NavicatPremium12Mac安装二、Mac将Wps本地文件备份到云端三、Mac安装Xmind8四、安装SublimeText1、[官网地址:](http://www.sublimetext.com/)2、下载中文插件五、安装SecureCRT六、安装BeyondCompare七、图片缩小大小一、NavicatPremium12Mac安装NavicatP......
  • golang 实现cas
    相比sync.WaitGroup里面的互斥锁,cas可以实现无锁等待一组任务执行完成后释放,示例代码如下funcTestCAS(t*testing.T){ varcountint32=10000 fori:=0;i<int(count);{ gofunc(){ deferfunc(){atomic.AddInt32(&count,-1)}() //dosomething //.........
  • JMeter在Mac下的安装
    其实不论操作系统是Windows、Unix(如MacOS)、Linux(如Ubuntu)等,JMeter所需要的基础环境配置都是类似的,本文介绍JMeterforMAC的安装与环境配置。JMeter安装步骤如下:安装JDK安装JMeter1、选择版本截止2018年10月,JMeter的最新版本是5.0,JMeter5.0需要Java8、Java9,所以我们最终......
  • mac M2 装PHP xdebug
    目前xdebug你不支持arm只能自编译pecel安装是arm64arch-arm64sudopeclinstallxdebug编译下载https://xdebug.org/download编译gitclonehttps://github.com/xdebug/xdebug.gitcdxdebugphpize./configure--enable-xdebug--host=arm-linux-gnueabimak......
  • golang 闭包,装饰器
    packagemainimport( "fmt" "strings")funcmakeSuffixFunc(suffixstring)func(string)string{ returnfunc(namestring)string{ if!strings.HasSuffix(name,suffix){ returnname+suffix } returnname }}funcmain()......
  • GoodNotes 5(mac手写笔记软件)
    GoodNotes5mac版是一款非常好用的手写笔记软件,GoodNotes5将会支持使用苹果系统的Mac电脑进行手写,并提供多种不同的笔刷来对字体进行书写。GoodNotes5这款软件采用了非常符合Mac用户习惯的界面,其手写风格和功能完全可以满足日常的记录需求。GoodNotes5在书写方面非常流畅,......
  • golang之fmt格式化
    常用fmt中用于格式化的占位符 普通占位符占位符说明举例输出%v相应值的默认格式。Printf("%v",people){zhangsan},%+v打印结构体时,会添加字段名Printf("%+v",people){Name:zhangsan......
  • MacOS-shell-PS1
    导航(返回顶部)1.shell1.1查看当前使用的shell1.2查看系统支持那些shell1.3修改默认的shell解释器2.PS1命令提示符2.1查看当前的PS12.2临时修改PS12.3永久修改PS12.4添加命令序号,时间2.5彩色显示2.6文件类型2.7彩色的命令前缀3.其他3.1增......
  • Parallels Desktop 虚拟机 V18.3.1 Mac版支持M
    最新版PD18.3.1破解版哪里可以下载呢?ParallelsDesktop是一款非常优秀的虚拟机应用,允许您并排运行Windows和Mac应用程序。ParallelsDesktopforMac18.3.1下载https://www.macw.com/mac/4237.html?id=ODA2NCZfJjI3LjE4Ny4yMjcuMTc2  ......
  • macos升级后安装cocoapods
    1、安装rvmcurl-Lget.rvm.io|bash-sstable2、安装rubyrvmautolibsread-onlyrvminstall2.7.2rvmuse2.7.2rvmlist 参考:https://juejin.cn/post/6950518188798902286https://blog.csdn.net/sinat_31057219/article/details/116601781 ......