ch := make(chan int, 10)
fmt.Println(cap(ch))
is function call cap(ch) constant or evaluated?
golang spec said:
The expression len(s) is constant if s is a string constant. The expressions len(s) and cap(s) are constants if the type of s is an array or pointer to an array and the expression s does not contain channel receives or (non-constant) function calls; in this case s is not evaluated. Otherwise, invocations of len and cap are not constant and s is evaluated.
seems that is evaluated.