Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Function 函数声明语法错误:意外的cornerFinder,应为(_Function_Go - Fatal编程技术网

Function 函数声明语法错误:意外的cornerFinder,应为(

Function 函数声明语法错误:意外的cornerFinder,应为(,function,go,Function,Go,我在尝试运行此代码时收到此错误: 语法错误:意外的拐角查找器,应为( 案例“-v2”: func cornerFinder(censusData[]CensusGroup){ 如果len(censusData)maxLong{ maxLong=censusData.longitude } if(censusData.longitude

我在尝试运行此代码时收到此错误: 语法错误:意外的拐角查找器,应为(

案例“-v2”:
func cornerFinder(censusData[]CensusGroup){
如果len(censusData)maxLong{
maxLong=censusData.longitude
}
if(censusData.longitude
    var cornerFinder func(censusData []CensusGroup)
    cornerFinder = func(censusData []CensusGroup) {
       ... function body from the question
    }
    cornerFinder(censusData)
此处不使用A,因为函数本身是递归调用的。

只允许在处使用。请将A指定给局部变量

    var cornerFinder func(censusData []CensusGroup)
    cornerFinder = func(censusData []CensusGroup) {
       ... function body from the question
    }
    cornerFinder(censusData)

此处不使用A,因为函数本身是递归调用的。

这解决了原始错误,但现在给出了未定义的错误:cornerFinder,我在其中递归调用函数非常感谢。这解决了原始错误,但现在给出了未定义的错误:cornerFinder,我在其中递归调用函数谢谢你。