An example of a round robin algorithm in Go that can be used for load balancing.
I suggest to use the following project structure for any microservice which usually is deployed using container image on kubernetes, exposes its core logic through HTTP or gRPC transport layers and interacts with other services using a message broker, such as kafka.
root/
├── cmd/
This gist includes two files, Makefile and the script.
Script downloads the protoc for a given os and arch, unzips the files to .bin
directory.
It won't download the zip file, if it was already downloaded.
Makefile provides gen-prot
entry point that ensures that protoc exists and generates the code from given proto files.
This setup ensures that the protoc and plugins versions are pinned and there is no need to donwload those tools manually.