diff --git a/.gitignore b/.gitignore index 5530b72..c6bb6da 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -app/conf/config_test.yaml app/go.sum +app/conf/config.yaml diff --git a/app/go.mod b/app/go.mod index 1415c29..1d59ec2 100644 --- a/app/go.mod +++ b/app/go.mod @@ -1,6 +1,6 @@ module main -go 1.18 +go 1.19 require ( github.com/go-ping/ping v1.1.0 @@ -9,8 +9,8 @@ require ( ) require ( - github.com/google/uuid v1.2.0 // indirect - golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 // indirect - golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005 // indirect + github.com/google/uuid v1.3.0 // indirect + golang.org/x/net v0.0.0-20220812174116-3211cb980234 // indirect + golang.org/x/sync v0.0.0-20220819030929-7fc1605a5dde // indirect + golang.org/x/sys v0.0.0-20220818161305-2296e01440c6 // indirect ) diff --git a/app/httpCheck.go b/app/httpCheck.go index 3e3fe4d..5abd62c 100644 --- a/app/httpCheck.go +++ b/app/httpCheck.go @@ -27,12 +27,14 @@ func httpCheck(update uint16, bot *tgbotapi.BotAPI, group int64, site struct { if err != nil { msg := tgbotapi.NewMessage(group, "Site "+site.Url+" HTTP get error") bot.Send(msg) + break } bodyBytes, err := io.ReadAll(resp.Body) if err != nil { msg := tgbotapi.NewMessage(group, "Site "+site.Url+" HTTP get error") bot.Send(msg) + break } body := string(bodyBytes) @@ -47,6 +49,7 @@ func httpCheck(update uint16, bot *tgbotapi.BotAPI, group int64, site struct { msg := tgbotapi.NewMessage(group, "Site "+site.Url+" defaced. Element '"+element+"' not found.") bot.Send(msg) deface = true + break } } if deface { diff --git a/app/main.go b/app/main.go index 2c624bf..1df124b 100644 --- a/app/main.go +++ b/app/main.go @@ -1,8 +1,8 @@ package main import ( - "io/ioutil" "log" + "os" "path/filepath" "strconv" "strings" @@ -39,7 +39,7 @@ func main() { // Read config from yaml config := Config{} filename, _ := filepath.Abs("./conf/config.yaml") - yamlFile, err := ioutil.ReadFile(filename) + yamlFile, err := os.ReadFile(filename) if err != nil { panic(err) }