code refactor
This commit is contained in:
parent
e2640c083b
commit
78d2ff6ec1
|
@ -2,7 +2,6 @@ package nginx_upstream_check
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
|
@ -113,7 +112,7 @@ func (ins *Instance) Init() error {
|
|||
}
|
||||
|
||||
if len(ins.Targets) == 0 {
|
||||
return errors.New("nginx_upstream_check targets empty")
|
||||
return types.ErrInstancesEmpty
|
||||
}
|
||||
|
||||
client, err := ins.createHTTPClient()
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package ntp
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"flashcat.cloud/categraf/config"
|
||||
"flashcat.cloud/categraf/inputs"
|
||||
"flashcat.cloud/categraf/types"
|
||||
"github.com/toolkits/pkg/container/list"
|
||||
"github.com/toolkits/pkg/nux"
|
||||
)
|
||||
|
@ -33,7 +33,7 @@ func (n *NTPStat) Drop() {}
|
|||
|
||||
func (n *NTPStat) Init() error {
|
||||
if len(n.NTPServers) == 0 {
|
||||
return errors.New("ntp servers empty")
|
||||
return types.ErrInstancesEmpty
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue