Removes unused GoFunc types (#1276)

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Takeshi Yoneda
2023-03-23 00:48:14 -07:00
committed by GitHub
parent cd1110c088
commit d8f356e644

View File

@@ -38,22 +38,6 @@ type HostFunc struct {
Code Code
}
// MustGoReflectFunc calls WithGoReflectFunc or panics on error.
func (f *HostFunc) MustGoReflectFunc(fn interface{}) *HostFunc {
if ret, err := f.WithGoReflectFunc(fn); err != nil {
panic(err)
} else {
return ret
}
}
// WithGoFunc returns a copy of the function, replacing its Code.GoFunc.
func (f *HostFunc) WithGoFunc(fn api.GoFunc) *HostFunc {
ret := *f
ret.Code.GoFunc = fn
return &ret
}
// WithGoModuleFunc returns a copy of the function, replacing its Code.GoFunc.
func (f *HostFunc) WithGoModuleFunc(fn api.GoModuleFunc) *HostFunc {
ret := *f
@@ -61,14 +45,6 @@ func (f *HostFunc) WithGoModuleFunc(fn api.GoModuleFunc) *HostFunc {
return &ret
}
// WithGoReflectFunc returns a copy of the function, replacing its Code.GoFunc.
func (f *HostFunc) WithGoReflectFunc(fn interface{}) (*HostFunc, error) {
ret := *f
var err error
ret.ParamTypes, ret.ResultTypes, ret.Code, err = parseGoReflectFunc(fn)
return &ret, err
}
type HostFuncNames struct {
Name string
ParamNames []string