Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support hiden interface #23

Open
visualfc opened this issue Feb 19, 2021 · 0 comments · May be fixed by #41
Open

support hiden interface #23

visualfc opened this issue Feb 19, 2021 · 0 comments · May be fixed by #41

Comments

@visualfc
Copy link
Collaborator

visualfc commented Feb 19, 2021

package main

import (
	"bytes"
	"io"
	"log"
)

// A version of bytes.Buffer without ReadFrom and WriteTo
type Buffer struct {
	bytes.Buffer
	io.ReaderFrom // conflicts with and hides bytes.Buffer's ReaderFrom.
	io.WriterTo   // conflicts with and hides bytes.Buffer's WriterTo.
}

func main() {
	b := new(Buffer)
	var i interface{} = b
	if v, ok := i.(io.WriterTo); ok {
		log.Println("error", v)
	}
}

---- output ------

error
damonchen added a commit to damonchen/gopherjs that referenced this issue Mar 30, 2021
damonchen added a commit to damonchen/gopherjs that referenced this issue Mar 30, 2021
@damonchen damonchen linked a pull request Mar 30, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant