I'm porting some old C++ code to go which used unsigned integers fairly often. I can understand their use in the C++ to help ensure positive values were only used in certain places.
However I believe there was also some implicit type conversion going on so in the go version I've ended up with code which looks like
Node{IsTerminal: true, TerminalNo: uint(RandPostiveIntUpTo(int(fitnessCases.Terminals)))})
Which seems a little unnecessary. I'm curious, is there much of a (time) cost to this casting, and am I losing any significant safety by switching to use int everywhere?