在学习的过程中,我遇到了以下错误:
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 ×1