Open a file according to a specific mode
(name string, flag int, perm os.FileMode)
| 57 | |
| 58 | // Open a file according to a specific mode |
| 59 | func Open(name string, flag int, perm os.FileMode) (*os.File, error) { |
| 60 | f, err := os.OpenFile(name, flag, perm) |
| 61 | if err != nil { |
| 62 | return nil, err |
| 63 | } |
| 64 | |
| 65 | return f, nil |
| 66 | } |
| 67 | |
| 68 | // MustOpen maximize trying to open the file |
| 69 | func MustOpen(fileName, filePath string) (*os.File, error) { |