以下摘自The Go Programming Language:
Two integers of the same type may be compared using the binary comparison operators below; the type of a comparison expression is a boolean.
== equal to
!= not equal to
< less than
<= less than or equal to
greater than
= greater than or equal toIn fact, all values of basic type—booleans, numbers, and strings—are comparable, meaning that two values of the same type may be compared using the == and != operators. Furthermore, integers, floating-point numbers, and strings are ordered by the comparison operators. The values of many other types are not comparable, and no other types are ordered.