The code for ExampleXxx is highly redundant and unclear, it is better if we could further simplify it.
Plus, consider breaking ExampleDialer by moving definitions for internal variables out of dialer_test.go. Currently go.dev generated a runable example for ExampleDialer but in fact it won't run since go.dev does not have a copy of testdata:
Output:
go: downloading github.com/gaukas/water v0.4.0
go: downloading github.com/tetratelabs/wazero v1.6.0
go: downloading google.golang.org/protobuf v1.32.0
prog.go:15:13: pattern transport/v0/testdata/plain.wasm: no matching files found
The code for
ExampleXxx
is highly redundant and unclear, it is better if we could further simplify it.Plus, consider breaking
ExampleDialer
by moving definitions for internal variables out ofdialer_test.go
. Currently go.dev generated a runable example forExampleDialer
but in fact it won't run since go.dev does not have a copy of testdata: