Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Feature: Make streams implement the existing Go io interfaces.

Open
#9 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
go
Domain
api

Research direction

Start by locating the generated StreamReader and StreamWriter types for stream and read their existing stream operations. Check how those types currently handle reading, writing, and closing, then verify that they satisfy the io.Reader, io.Writer, io.ReadCloser, and io.WriteCloser interfaces and can be passed to the JSON encoder shown in the issue.

Written by the indexing model from the issue text.

Description

Description

In order to make bindings more Go idiomatic we should make streams implement the io.Reader, io.Writer and io.Closer interfaces. This would enable more seamless integration with existing Go functions.

Example

For the following wit type stream<u8> the types should implement the following:

// StreamReader implements io.ReadCloser
var _ io.ReadCloser = (*witTypes.StreamReader[uint8])(nil)

// io.ReadCloser
type ReadCloser interface {
    Read(p []byte) (n int, err error)
    Close() error
}

// StreamWriter implements io.WriteCloser
var _ io.WriteCloser = (*witTypes.StreamWriter[uint8])(nil)

// io.WriteCloser
type WriteCloser interface {
    Write(p []byte) (n int, err error)
    Close() error
}

This would allow you to for example, encode json straight onto the stream:

// Create stream
tx, rx := foo.MakeStreamU8()

// Encode json
err := son.NewEncoder(tx).Encode(map[string]string{
    "foo": "bar",
})
...
Dominant language
Go
Stars
0
Forks
6
Avg merge
1h
Merged PRs (30d)
3

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bytecodealliance/go-pkg

All issues in bytecodealliance/go-pkg

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.