diff --git a/go.mod b/go.mod index 2461c8b..ad13996 100644 --- a/go.mod +++ b/go.mod @@ -2,17 +2,17 @@ module git.exozy.me/exozyme/status go 1.21.1 -require github.com/cbroglie/mustache v1.4.0 - -require maunium.net/go/mautrix v0.16.1 - -require github.com/pelletier/go-toml/v2 v2.1.0 +require ( + github.com/cbroglie/mustache v1.4.0 + github.com/pelletier/go-toml/v2 v2.1.0 + github.com/prometheus-community/pro-bing v0.3.0 + maunium.net/go/mautrix v0.16.1 +) require ( github.com/google/uuid v1.3.1 // indirect github.com/mattn/go-colorable v0.1.12 // indirect github.com/mattn/go-isatty v0.0.14 // indirect - github.com/prometheus-community/pro-bing v0.3.0 // indirect github.com/rs/zerolog v1.30.0 // indirect github.com/tidwall/gjson v1.16.0 // indirect github.com/tidwall/match v1.1.1 // indirect diff --git a/main.go b/main.go index c7e15ef..d89f77e 100644 --- a/main.go +++ b/main.go @@ -2,6 +2,7 @@ package main import ( "context" + "embed" "io/fs" "log" "net" @@ -9,8 +10,6 @@ import ( "os" "time" - "embed" - "git.exozy.me/exozyme/status/core" "git.exozy.me/exozyme/status/scanner" "github.com/cbroglie/mustache" @@ -57,7 +56,7 @@ func rootPage(w http.ResponseWriter, r *http.Request) { // get service status' timeout := time.Second - ctx, cancel := context.WithTimeout(context.Background(), timeout) + ctx, cancel := context.WithTimeout(context.Background(), timeout) data := scanner.TestMultipleServices(ctx, config.Service) cancel() diff --git a/proto/matrix/main.go b/proto/matrix/main.go index 459d31c..7612c9e 100644 --- a/proto/matrix/main.go +++ b/proto/matrix/main.go @@ -1,8 +1,8 @@ package main import ( - "os" "fmt" + "os" "strings" "time" diff --git a/scanner/httpSuccess.go b/scanner/httpSuccess.go index 41c2624..55850f3 100644 --- a/scanner/httpSuccess.go +++ b/scanner/httpSuccess.go @@ -7,7 +7,7 @@ func CheckHTTP200(ctx Context, url string) (bool, string) { if err != nil { return false, err.Error() } - resp, err := http.DefaultClient.Do(req) + resp, err := http.DefaultClient.Do(req) if err != nil { return false, err.Error() } diff --git a/scanner/index.go b/scanner/index.go index 96f22c5..a408ab2 100644 --- a/scanner/index.go +++ b/scanner/index.go @@ -70,7 +70,7 @@ func TestService(service ServiceConfig, ctx context.Context) ServiceStatus { func TestMultipleServices(ctx Context, services []ServiceConfig) []ServiceStatus { var wg sync.WaitGroup - + var data []ServiceStatus = make([]ServiceStatus, len(services)) for i, v := range services {