A common pattern used in larger system is to direct all writes to the master but load balance the reads to the slaves (with the proviso that if you readback a write you do it on the master) hence its common to have a class that handles that, which encompasses two connections, one for read and one for write.
Alternatively you can put a query proxy in place that handles that for you, examples are sql-relay
Sql relay sits in-front of your replicated cluster and routes queries according to certain rules. It also supports load balancing and fail-over.
There is a "C" binding library that could easily be wrapped for go.