“used as value” in function call

前端 未结 1 1105
孤城傲影
孤城傲影 2020-12-13 11:31

What\'s the proper way of calling functions when evaluating their values in conditional statements?

package main
import \"fmt\"
func main(){
        if sumTh         


        
相关标签:
1条回答
  • 2020-12-13 12:17

    You've forgotten to declare a return value. It should be:

    func sumThis(a, b int) int {
    // ...
    
    0 讨论(0)
提交回复
热议问题