fix redundant file open/close

This commit is contained in:
Alex Suraci
2016-07-24 08:49:22 -07:00
parent 2f7e52d3cb
commit 7d10e39540

View File

@@ -153,13 +153,6 @@ func (c *OutCommand) fileContents(path string) (string, error) {
} }
func (c *OutCommand) upload(release *github.RepositoryRelease, filePath string) error { func (c *OutCommand) upload(release *github.RepositoryRelease, filePath string) error {
file, err := os.Open(filePath)
if err != nil {
return err
}
defer file.Close()
fmt.Fprintf(c.writer, "uploading %s\n", filePath) fmt.Fprintf(c.writer, "uploading %s\n", filePath)
name := filepath.Base(filePath) name := filepath.Base(filePath)