use defer blah.Close() where appropraite