Skip to content

Commit aa2a909

Browse files
committed
refactor: replace exists() with pathExists()
Both were the exact same function.
1 parent c2595ab commit aa2a909

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

internal/dockergen/template.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ import (
2020
"text/template"
2121
)
2222

23-
func exists(path string) (bool, error) {
24-
_, err := os.Stat(path)
25-
if err == nil {
26-
return true, nil
27-
}
28-
if os.IsNotExist(err) {
29-
return false, nil
30-
}
31-
return false, err
32-
}
33-
3423
func getArrayValues(funcName string, entries interface{}) (*reflect.Value, error) {
3524
entriesVal := reflect.ValueOf(entries)
3625

@@ -435,7 +424,7 @@ func newTemplate(name string) *template.Template {
435424
"contains": contains,
436425
"dict": dict,
437426
"dir": dirList,
438-
"exists": exists,
427+
"exists": pathExists,
439428
"first": arrayFirst,
440429
"groupBy": groupBy,
441430
"groupByKeys": groupByKeys,

0 commit comments

Comments
 (0)