INNER CODE UNIT · Go
main
donknap/dpanel · main.go:56
func main() {
// 兼容没有配置存储目录的情况
if os.Getenv("STORAGE_LOCAL_PATH") == "" {
exePath, _ := os.Executable()
_ = os.Setenv("STORAGE_LOCAL_PATH", filepath.Dir(exePath))
}
storagePath := os.Getenv("STORAGE_LOCAL_PATH")
storagePathStat, err := os.Stat(storagePath)
if err == nil && !storagePathStat.IsDir() {
panic(fmt.Sprintf("%s must be a directory", storagePathStat.Name()))
}
if err != nil {
_ = os.MkdirAll(storagePath, os.ModePerm)
}
myApp := app.NewApp(
app.Option{