code refactor

This commit is contained in:
Ulric Qin 2022-05-29 17:13:21 +08:00
parent 80ffb36638
commit daaae99cce
1 changed files with 6 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package switch_legacy
import (
"errors"
"fmt"
"log"
"sync"
@ -136,6 +137,11 @@ type Custom struct {
}
func (ins *Instance) Init() error {
ips := ins.parseIPs()
if len(ips) == 0 {
return errors.New("ips empty")
}
ins.lastifmap = NewLastifMap()
return nil
}