==> Formulae
protobuf protobuf-c protobuf@3.6 swift-protobuf
langhuaili@langhuailideiMac Dyson-o2o % brew install protobuf
Updating Homebrew...
==> Downloading https://ghcr.io/v2/homebrew/core/six/manifests/1.16.0_2-1
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/six/blobs/sha256:560f73cafaea61
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/manifests/3.17.3
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/protobuf/blobs/sha256:2f25a4051
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Installing dependencies for protobuf: six
==> Installing protobuf dependency: six
==> Pouring six--1.16.0_2.all.bottle.1.tar.gz
langhuaili@langhuailideiMac Dyson-o2o % make run
make gen
make http
cd api && protoc --proto_path=. \
--proto_path=../third_party \
--go_out=paths=source_relative:. \
--go-grpc_out=paths=source_relative:. \
--go-gin1_out=paths=source_relative:. \
--validate_out=paths=source_relative,lang=go:. \
--go-errors_out=paths=source_relative:. \
--openapiv2_out . \
--openapiv2_opt logtostderr=true \
./eticket/types.proto ./common/error.proto ./code_merchant/v1/ticket.proto ./code_merchant/v1/notify.proto
make tag
cd api && \
for name in ./eticket/types.pb.go ./common/error.pb.go ./common/error_errors.pb.go ./code_merchant/v1/notify_gin.pb.go ./code_merchant/v1/ticket.pb.go ./code_merchant/v1/notify.pb.go ./code_merchant/v1/notify_grpc.pb.go ./code_merchant/v1/ticket_gin.pb.go ./code_merchant/v1/ticket_grpc.pb.go; \
do \
protoc-go-inject-tag -input=$name; \
done
make wire
cd cmd/Dyson-o2o && wire
wire: dyson-o2o/cmd/Dyson-o2o: wrote /Users/langhuaili/tools/dnmp/www/Dyson-o2o/cmd/Dyson-o2o/wire_gen.go
go mod tidy
go: downloading gorm.io/gen v0.2.44
go: downloading github.com/google/go-cmp v0.5.7
还是不行 按答案 我们指示我们应该先加环境变量
vim ~/.bash_profile
文件内输入
export GO_PATH=~/go
export PATH=$PATH:/$GO_PATH/bin
重载文件
source ~/.bash_profile
执行成功