相关疑难解决方法(0)

在调用方法表达式时没有足够的参数

在学习的过程中,我遇到了以下错误:

prog.go:18: not enough arguments in call to method expression JSONParser.Parse 
Run Code Online (Sandbox Code Playgroud)

在我的测试程序中(https://play.golang.org/p/PW9SF4c9q8):

package main


type Schema struct {
}

type JSONParser struct {
}

func (jsonParser JSONParser) Parse(toParse []byte) ([]Schema, int) {
    var schema []Schema
    // whatever parsing logic
    return schema, 0 
}

func main() {
    var in []byte
    actual, err2 := JSONParser.Parse(in)
}
Run Code Online (Sandbox Code Playgroud)

有谁愿意帮助我继续前进?

go

13
推荐指数
1
解决办法
7368
查看次数

标签 统计

go ×1