fix: 修复lint问题
This commit is contained in:
@ -9,11 +9,11 @@ import (
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (w *watch) queryRecord(value string) (*dnspod.RecordListItem, error) {
|
||||
func (w *watch) queryRecord(domain, name, value string) (*dnspod.RecordListItem, error) {
|
||||
// 实例化一个请求对象,每个接口都会对应一个request对象
|
||||
request := dnspod.NewDescribeRecordListRequest()
|
||||
|
||||
request.Domain = common.StringPtr(w.config.Domain)
|
||||
request.Domain = common.StringPtr(domain)
|
||||
|
||||
response, err := w.client.DescribeRecordList(request)
|
||||
if err != nil {
|
||||
@ -21,7 +21,7 @@ func (w *watch) queryRecord(value string) (*dnspod.RecordListItem, error) {
|
||||
return nil, err
|
||||
}
|
||||
for _, v := range response.Response.RecordList {
|
||||
if *v.Name == w.config.Name && *v.Value == value {
|
||||
if *v.Name == name && *v.Value == value {
|
||||
logger.Default().Info("record found", zap.Any("record", v))
|
||||
return v, nil
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ func (w *watch) Start(ctx context.Context, cfg *configs.Config) error {
|
||||
}
|
||||
for _, c := range w.config.CheckDomain {
|
||||
for _, v := range c.Value {
|
||||
r, err := w.queryRecord(v)
|
||||
r, err := w.queryRecord(c.Domain, c.Name, v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user