What have you tried and where do you get stuck? This sounds like a homework exercise so the best thing to do is show us what you have and we can help with suggested next steps.
I agree that this sounds like homework and some code would be good to see where exactly you get stuck. https://godoc.org/strconv is probably what you’re looking for