Created
December 8, 2015 13:07
-
-
Save kei2100/d7dcf04c177846f90f3e to your computer and use it in GitHub Desktop.
closer test golang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Try to close the reader if the io.Closer interface is implemented | |
if closer, ok := src.(io.Closer); ok { | |
closer.Close() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment