MCPcopy
hub / github.com/avelino/awesome-go / mkdirAll

Function mkdirAll

main.go:185–203  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

183}
184
185func 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
205func renderCategories(categories map[string]Category) error {
206 for _, category := range categories {

Callers 4

TestRenderIndexFunction · 0.85
dropCreateDirFunction · 0.85
renderCategoriesFunction · 0.85
renderProjectsFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestRenderIndexFunction · 0.68