Chore: cleanup code

This commit is contained in:
yaling888
2022-07-01 18:34:36 +08:00
parent e1fe8ce3b2
commit ae6cc1d67d
25 changed files with 159 additions and 189 deletions

View File

@@ -125,10 +125,8 @@ func parseURLTestOption(config map[string]any) []urlTestOption {
opts := []urlTestOption{}
// tolerance
if elm, ok := config["tolerance"]; ok {
if tolerance, ok := elm.(int); ok {
opts = append(opts, urlTestWithTolerance(uint16(tolerance)))
}
if tolerance, ok := config["tolerance"].(int); ok {
opts = append(opts, urlTestWithTolerance(uint16(tolerance)))
}
return opts