gitlab.com/ethan.reesor/vscode-notebooks/yaegi@v0.0.0-20220417214422-5c573557938e/_test/type20.go (about) 1 package main 2 3 import ( 4 "io" 5 "strings" 6 ) 7 8 func isCloser(r io.Reader) bool { 9 _, ok := r.(io.Closer) 10 return ok 11 } 12 13 func main() { 14 println(isCloser(strings.NewReader("test"))) 15 } 16 17 // Output: 18 // false