错误对我来说似乎足够清楚,它表明您需要指定B.proto所在的确切目录
protoc B.proto --go_out=. --proto_path=$GOPATH/src/B
或者如果您已经在文件夹B中,
protoc B.proto --go_out=.