mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
19 lines
198 B
Go
19 lines
198 B
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
"strings"
|
|
)
|
|
|
|
func isCloser(r io.Reader) bool {
|
|
_, ok := r.(io.Closer)
|
|
return ok
|
|
}
|
|
|
|
func main() {
|
|
println(isCloser(strings.NewReader("test")))
|
|
}
|
|
|
|
// Output:
|
|
// false
|