polywrap / wrap-cli

Used to create, build, and integrate wraps.
https://polywrap.io
MIT License
170 stars 52 forks source link

Go wraps cannot throw errors #1927

Open krisbitney opened 1 year ago

krisbitney commented 1 year ago

Describe the bug This is the generated interface for a module with a single method that returns a string:

type Module interface {
    Obscure(args *ArgsObscure) string
}

Since errors cannot be thrown in Go, we should handle them in the bindings as with do with Rust's Result type:

type Module interface {
    Obscure(args *ArgsObscure) (string, error)
}