Skip to content

Commit b9dede1

Browse files
committed
fix bug for space in tag and delete redundant syntax
1 parent a7bdd9e commit b9dede1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ func regexpDeal(bodyStatus string, body io.ReadCloser) io.ReadCloser {
209209
match := tagCompile.FindAllStringSubmatch(resValue.(string), -1)
210210
for _, matchArr := range match {
211211
if len(matchArr) > 2 {
212-
tagConvRes[matchArr[1]] = matchArr[2]
212+
tagConvRes[strings.TrimSpace(matchArr[1])] = strings.TrimSpace(matchArr[2])
213213
}
214214
}
215215
}
@@ -361,7 +361,7 @@ func initUnitMap(cfg *ini.File) error {
361361
return err
362362
}
363363

364-
if (samplingIntervalSecond == 0 || samplingIntervalSecond == 0 ||
364+
if (samplingIntervalSecond == 0 ||
365365
inhibitionIntervalSecond == 0 || inhibitionThresholdNum == 0) {
366366
log.WithFields(log.Fields{
367367
"severityName": severityName,
@@ -396,7 +396,7 @@ func initUnitMap(cfg *ini.File) error {
396396
return err
397397
}
398398

399-
if (samplingIntervalSecond == 0 || samplingIntervalSecond == 0 ||
399+
if (samplingIntervalSecond == 0 ||
400400
inhibitionIntervalSecond == 0 || inhibitionThresholdNum == 0) {
401401
log.WithFields(log.Fields{
402402
"severityName": severityName,
@@ -753,4 +753,4 @@ func main() {
753753
log.Println("the zabbix-robot is runnig ......")
754754
http.HandleFunc(MainURL, alertHandler)
755755
http.ListenAndServe(MainListen, nil)
756-
}
756+
}

0 commit comments

Comments
 (0)