You can press CTRL-C and CTRL-D on the mongo-server and mongo-cli respectively to stop the containers. Don't forget to remove the containers as well.
$ # This should remove both mongo-server and mongo-cli
$ docker-compose down
Run Go programL
$ go run ./main.go
Alternatively, you can run everything with the following command.
$ make
Notes
We deliberately hard code the password to connect to MongoDB to keep the sample code simple and easy to understand. Do not do this in your code, especially production code.