mirror of
https://github.com/felixangell/phi.git
synced 2024-10-26 17:18:31 +03:00
fix file creation from pr
This commit is contained in:
parent
5dc4710546
commit
88c0a3caac
@ -82,7 +82,8 @@ func (b *Buffer) OpenFile(filePath string) {
|
|||||||
|
|
||||||
// if the file doesn't exist, try to create it before reading it
|
// if the file doesn't exist, try to create it before reading it
|
||||||
if _, err := os.Stat(filePath); os.IsNotExist(err) {
|
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)
|
panic(err)
|
||||||
} else {
|
} else {
|
||||||
f.Close()
|
f.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user