From b64fe91b83eba6adf96f4bfbc185865f327bc838 Mon Sep 17 00:00:00 2001 From: JustSong Date: Tue, 22 Nov 2022 20:19:01 +0800 Subject: [PATCH] chore: remove useless code --- common/init.go | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/common/init.go b/common/init.go index 66fcd7e..8c2c9d8 100644 --- a/common/init.go +++ b/common/init.go @@ -12,19 +12,8 @@ var ( Port = flag.Int("port", 3000, "the listening port") PrintVersion = flag.Bool("version", false, "print version and exit") LogDir = flag.String("log-dir", "", "specify the log directory") - //Host = flag.String("host", "localhost", "the server's ip address or domain") - //Path = flag.String("path", "", "specify a local path to public") - //VideoPath = flag.String("video", "", "specify a video folder to public") - //NoBrowser = flag.Bool("no-browser", false, "open browser or not") ) -// UploadPath Maybe override by ENV_VAR -var UploadPath = "upload" - -//var ExplorerRootPath = UploadPath -//var ImageUploadPath = "upload/images" -//var VideoServePath = "upload" - func init() { flag.Parse() @@ -39,12 +28,6 @@ func init() { if os.Getenv("SQLITE_PATH") != "" { SQLitePath = os.Getenv("SQLITE_PATH") } - if os.Getenv("UPLOAD_PATH") != "" { - UploadPath = os.Getenv("UPLOAD_PATH") - //ExplorerRootPath = UploadPath - //ImageUploadPath = path.Join(UploadPath, "images") - //VideoServePath = UploadPath - } if *LogDir != "" { var err error *LogDir, err = filepath.Abs(*LogDir) @@ -58,21 +41,4 @@ func init() { } } } - //if *Path != "" { - // ExplorerRootPath = *Path - //} - //if *VideoPath != "" { - // VideoServePath = *VideoPath - //} - // - //ExplorerRootPath, _ = filepath.Abs(ExplorerRootPath) - //VideoServePath, _ = filepath.Abs(VideoServePath) - //ImageUploadPath, _ = filepath.Abs(ImageUploadPath) - // - if _, err := os.Stat(UploadPath); os.IsNotExist(err) { - _ = os.Mkdir(UploadPath, 0777) - } - //if _, err := os.Stat(ImageUploadPath); os.IsNotExist(err) { - // _ = os.Mkdir(ImageUploadPath, 0777) - //} }