fix file creation from pr

This commit is contained in:
Felix Angell 2018-04-16 13:58:30 +01:00
parent 5dc4710546
commit 88c0a3caac

View File

@ -82,7 +82,8 @@ func (b *Buffer) OpenFile(filePath string) {
// if the file doesn't exist, try to create it before reading it
if _, err := os.Stat(filePath); os.IsNotExist(err) {
if f, err = os.Create(filePath); err != nil {
f, err := os.Create(filePath)
if err != nil {
panic(err)
} else {
f.Close()