golang在两个uint值上使用math.max的正确方法是什么?

This is what I do, it is extremely ugly.

What is the right way to use math.Max for 2 uint s?

vs.curView.Viewnum =uint(math.Max(float64(args.Viewnum+1), float64(vs.curView.Viewnum)))

The main reason math.Max exists is to ensure some of the special cases of IEEE floating point are handled correctly (positive and negative infinity, NaN and signed zeroes).

These issues are not relevant for simple integers, so you may as well just use the obvious implementation. Something like:

if args.Viewnum+1 > vs.curView.Viewnum {
    vs.curView.Viewnum = args.Viewnum+1
}