02 2022 档案
摘要:多个defer的执行顺序为“后进先出”; defer、return、返回值三者的执行逻辑应该是: (1) return最先执行,return负责将结果写入返回值中; (2) 接着defer开始执行一些收尾工作; (3) 最后函数携带当前返回值退出。 1. 不带命名返回值的函数 如果函数的返回值是无名
阅读全文
摘要:问题 $ protoc --go_out=. *.proto protoc-gen-go: unable to determine Go import path for "xxx.proto" Please specify either: • a "go_package" option in the
阅读全文