我目前正在使用以下代码连接到package main
import "fmt"
// Execute the function which returns this struct
type item struct {
key string
value string
otherValue string
}
func todo(param string) (*item, error) {
return &item{
key: param,
}, nil
}
type BindFunc struct {
Params func(params ...interface{}) *BindFunc
Results func(results ...interface{}) *BindFunc
Do func()
}
// NewBindFunc is a proxy function should run the function and bind the results
// to the result
func NewBindFunc(fn interface{}) *BindFunc {
b := &BindFunc{}
b.Params = func(params ...interface{}) *BindFunc {
return b
}
b.Results = func(results ...interface{}) *BindFunc {
return b
}
b.Do = func() {
// execute the function
}
return b
}
func main() {
var result item
var err error
NewBindFunc(todo).
Params("Param").
Results(&result, &err).
Do()
fmt.Println(result.key)
}
,但最终出现错误
我假设它必须使用驱动程序名称来做某事,但是我不确定。请帮助
netezza