(path string)
| 183 | } |
| 184 | |
| 185 | func mkdirAll(path string) error { |
| 186 | _, err := os.Stat(path) |
| 187 | // directory is exists |
| 188 | if err == nil { |
| 189 | return nil |
| 190 | } |
| 191 | |
| 192 | // unexpected error |
| 193 | if !os.IsNotExist(err) { |
| 194 | return fmt.Errorf("unexpected result of dir stat: %w", err) |
| 195 | } |
| 196 | |
| 197 | // directory is not exists |
| 198 | if err := os.MkdirAll(path, 0755); err != nil { |
| 199 | return fmt.Errorf("midirAll: %w", err) |
| 200 | } |
| 201 | |
| 202 | return nil |
| 203 | } |
| 204 | |
| 205 | func renderCategories(categories map[string]Category) error { |
| 206 | for _, category := range categories { |
no outgoing calls