Skip to content

go: make generated code more idiomatic #1461

@dicej

Description

@dicej

wit-bindgen-go was written by a Go novice (me) and could use some feedback from experienced Go developers regarding API idioms. Here are some examples of potential improvements:

  • Make functions which return result<T, E> in WIT return e.g. (T, *E) in Go and ensure that *E implements the standard Go Error interface
  • Implement io.Writer for StreamWriter[u8] and io.Reader for StreamReader[u8]

I'm sure others will have more ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gen-goRelated to the Go code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions