|
|
@@ -11,6 +11,8 @@ import (
|
|
|
"strings"
|
|
|
"sync"
|
|
|
"time"
|
|
|
+
|
|
|
+ "github.com/kardianos/osext"
|
|
|
)
|
|
|
|
|
|
// 配置文件
|
|
|
@@ -21,8 +23,12 @@ type configuration struct {
|
|
|
var G_config configuration
|
|
|
|
|
|
func readConfig() {
|
|
|
+ folderPath, err := osext.ExecutableFolder()
|
|
|
+ if err != nil {
|
|
|
+ log.Fatal(err)
|
|
|
+ }
|
|
|
// 打开文件
|
|
|
- file, err := os.Open("config.json")
|
|
|
+ file, err := os.Open(folderPath + "/config.json")
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
@@ -36,7 +42,7 @@ func readConfig() {
|
|
|
if err != nil {
|
|
|
fmt.Println("Error:", err)
|
|
|
}
|
|
|
- fmt.Println("proxy:" + G_config.Proxy)
|
|
|
+ // fmt.Println("proxy:" + G_config.Proxy)
|
|
|
}
|
|
|
|
|
|
// 下载
|
|
|
@@ -201,5 +207,6 @@ func main() {
|
|
|
proxy = G_config.Proxy
|
|
|
}
|
|
|
|
|
|
+ fmt.Println("proxy:", proxy)
|
|
|
http_down(name, list, proxy)
|
|
|
}
|