app/util/util.go

24 lines
345 B
Go
Raw Normal View History

2021-12-16 04:11:33 +00:00
package util
import (
"os"
"path/filepath"
)
2021-12-19 10:52:40 +00:00
var PROD bool = true
2021-12-16 04:11:33 +00:00
func Mkdir(args ...interface{}) error {
var path string
var mode os.FileMode
mode = 0755
for _, arg := range args {
switch arg := arg.(type) {
case string:
path = filepath.Join(path, arg)
case os.FileMode:
mode = arg
}
}
return os.MkdirAll(path, mode)
}