(path string, errMsgPath string)
| 105 | } |
| 106 | |
| 107 | func ReadFileBytesErrPath(path string, errMsgPath string) ([]byte, error) { |
| 108 | path, err := EscapeTilde(path) |
| 109 | if err != nil { |
| 110 | return nil, err |
| 111 | } |
| 112 | |
| 113 | if err := CheckFileErrPath(path, errMsgPath); err != nil { |
| 114 | return nil, err |
| 115 | } |
| 116 | |
| 117 | fileBytes, err := ioutil.ReadFile(path) |
| 118 | if err != nil { |
| 119 | return nil, errors.Wrap(err, errors.Message(ErrorReadFile(errMsgPath))) |
| 120 | } |
| 121 | |
| 122 | return fileBytes, nil |
| 123 | } |
| 124 | |
| 125 | func CreateFile(path string) error { |
| 126 | cleanPath, err := EscapeTilde(path) |
no test coverage detected