go
大头哇
一个进步缓慢的python小白
展开
-
protoc: does not implement protoreflect.ProtoMessage (missing ProtoReflect method)
在学习protobuf做第一个小例子时出现如下错误:# command-line-arguments./test_proto.go:23:29: cannot use test (type *Student) as type protoreflect.ProtoMessage in argument to marshaler.Marshal: *Student does not implement protoreflect.ProtoMessage (missing ProtoRefle原创 2021-05-19 09:57:00 · 4459 阅读 · 0 评论 -
ubuntu18.04下protoc使用报错:--go_out: protoc-gen-go: Plugin failed with status code 1.
protoc使用报错:–go_out: protoc-gen-go: Plugin failed with status code 1.问题描述:环境配置:解决方法:sudo apt-get install golang-goprotobuf-dev原创 2021-05-19 09:16:07 · 736 阅读 · 0 评论 -
go-列出当前目录下的所有文件
go-列出当前目录下的所有文件使用ReadDir函数,并且判断当前是目录文件还是单独文件,如果是目录文件则递归打印。package mainimport ( "fmt" "io/ioutil" "os")func listAll(path string, curLayer int){ fileInfos,err:=ioutil.ReadDir(path) if err!=nil{ fmt.Println("ReadDir failed,error:%v\n",err) ret原创 2021-05-06 08:35:33 · 1419 阅读 · 0 评论