Skip to content

Instantly share code, notes, and snippets.

@compnski
Created December 17, 2014 01:10
Show Gist options
  • Save compnski/d30c9cc0463b3fbcb6de to your computer and use it in GitHub Desktop.
Save compnski/d30c9cc0463b3fbcb6de to your computer and use it in GitHub Desktop.
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