Can someone convert this python code to go code?

What have you tried so far and how is it not working?