Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import "fmt"
import "io"
type notACloser struct {
Close func() error
}
func close() error {
fmt.Println("Close called")
return nil;
}
func closeme(cls io.Closer) {
cls.Close()
}
func main() {
nc := notACloser{Close:close}
nc.Close()
closeme(nc)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.