mirror of
https://github.com/bestnite/sub2sing-box.git
synced 2025-10-26 09:11:01 +00:00
✨ The convert command has a new flag: config
🐛 Fix Fetch func cannot return err 🐛 Fix cannot read templates correctly
This commit is contained in:
@@ -8,13 +8,15 @@ import (
|
||||
func Fetch(url string, maxRetryTimes int) (string, error) {
|
||||
retryTime := 0
|
||||
var err error
|
||||
var resp *http.Response
|
||||
for retryTime < maxRetryTimes {
|
||||
resp, err := http.Get(url)
|
||||
resp, err = http.Get(url)
|
||||
if err != nil {
|
||||
retryTime++
|
||||
continue
|
||||
}
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
var data []byte
|
||||
data, err = io.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
retryTime++
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user