checker: Fix go vet
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
nemunaire 2021-10-31 20:11:58 +01:00
parent 65230f4fc2
commit db46b615c3
2 changed files with 4 additions and 4 deletions

View File

@ -447,7 +447,7 @@ func check_matrix_federation(domain string) (version string, err error) {
var federationTest matrix_result var federationTest matrix_result
if err = json.NewDecoder(resp.Body).Decode(&federationTest); err != nil { if err = json.NewDecoder(resp.Body).Decode(&federationTest); err != nil {
log.Printf("Error in check_matrix_federation, when decoding json: %w", err.Error()) log.Printf("Error in check_matrix_federation, when decoding json: %s", err.Error())
return "", fmt.Errorf("Sorry, the federation tester is broken. Check on https://federationtester.matrix.org/#%s", strings.TrimSuffix(domain, ".")) return "", fmt.Errorf("Sorry, the federation tester is broken. Check on https://federationtester.matrix.org/#%s", strings.TrimSuffix(domain, "."))
} else if federationTest.FederationOK { } else if federationTest.FederationOK {
version = federationTest.Version.Name + " " + federationTest.Version.Version version = federationTest.Version.Name + " " + federationTest.Version.Version
@ -499,7 +499,7 @@ func check_matrix_client(domain string) (version string, err error) {
if resp.StatusCode < 300 { if resp.StatusCode < 300 {
var wellknown matrix_wk_client var wellknown matrix_wk_client
if err = json.NewDecoder(resp.Body).Decode(&wellknown); err != nil { if err = json.NewDecoder(resp.Body).Decode(&wellknown); err != nil {
log.Printf("Error in check_matrix_client, when decoding json: %w", err.Error()) log.Printf("Error in check_matrix_client, when decoding json: %s", err.Error())
return "", fmt.Errorf("File at https://%s/.well-known/matrix/client is invalid: JSON parse error", strings.TrimSuffix(domain, ".")) return "", fmt.Errorf("File at https://%s/.well-known/matrix/client is invalid: JSON parse error", strings.TrimSuffix(domain, "."))
} else if wellknown.Homeserver.BaseURL != "" { } else if wellknown.Homeserver.BaseURL != "" {
if baseurl, err := url.Parse(wellknown.Homeserver.BaseURL); err != nil { if baseurl, err := url.Parse(wellknown.Homeserver.BaseURL); err != nil {
@ -528,7 +528,7 @@ func check_matrix_client(domain string) (version string, err error) {
var clientTest matrix_client_versions var clientTest matrix_client_versions
if err = json.NewDecoder(resp2.Body).Decode(&clientTest); err != nil { if err = json.NewDecoder(resp2.Body).Decode(&clientTest); err != nil {
log.Printf("Error in check_matrix_client, when decoding versions json: %w", err.Error()) log.Printf("Error in check_matrix_client, when decoding versions json: %s", err.Error())
return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: JSON parse error: %s", HomeserverBase, err.Error()) return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: JSON parse error: %s", HomeserverBase, err.Error())
} else if len(clientTest.Versions) == 0 { } else if len(clientTest.Versions) == 0 {
return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: no protocol version supported", HomeserverBase) return "", fmt.Errorf("File at %s/_matrix/client/versions is invalid: no protocol version supported", HomeserverBase)

View File

@ -37,7 +37,7 @@ func main() {
// Check one or more students and exit // Check one or more students and exit
for _, std_login := range flag.Args() { for _, std_login := range flag.Args() {
if verbose { if verbose {
log.Println("==============================\n") log.Printf("==============================\n\n")
} }
if std, err := adlin.GetStudentByLogin(std_login); err != nil { if std, err := adlin.GetStudentByLogin(std_login); err != nil {