mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
21 lines
225 B
Go
21 lines
225 B
Go
package main
|
|
|
|
import "io"
|
|
|
|
type B []byte
|
|
|
|
func (b B) Write(p []byte) (n int, err error) {
|
|
b = p
|
|
return len(p), nil
|
|
}
|
|
|
|
func main() {
|
|
b := B{}
|
|
a := make([]io.Writer, 0)
|
|
a = append(a, b)
|
|
println(len(a))
|
|
}
|
|
|
|
// Output:
|
|
// 1
|