How does one specify the maximum value representable for an unsigned integer type?
I would like to know how to initialize min in the loop below
One way to solve this problem is to get the starting points from the values themselves:
var minLen, maxLen uint
if len(sliceOfThings) > 0 {
minLen = sliceOfThings[0].minLen
maxLen = sliceOfThings[0].maxLen
for _, thing := range sliceOfThings[1:] {
if minLen > thing.minLen { minLen = thing.minLen }
if maxLen < thing.maxLen { maxLen = thing.maxLen }
}
}