sorry, a mistake, "int" -> "[]byte".--On Friday, November 12, 2021 at 1:08:50 PM UTC+8 tapi...@gmail.com wrote:package main
import (
"fmt"
)
type byteview interface{string | int}
type ByteView[T byteview] struct {v [0]T}
func (bv ByteView[T]) Write(v T) (int, error) {
return 0, nil
}
type Writer[T byteview] interface {
Write(bs T)(int, error)
}
type ioWriter = Writer[[]byte] // []byte does not satisfy comparable
func main() {
fmt.Println("Hello, playground")
}
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/5342cd82-a51f-4d9d-af79-d7a5e2a1b663n%40googlegroups.com.
fine? It should not.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/087f84b6-7866-4e36-8bc9-a85170a26e7en%40googlegroups.com.