reusable go code