From 9a9ac337661b8d39a206d48f3b599cfa913b9cd2 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Sat, 13 Jan 2024 16:22:49 +0100 Subject: [PATCH] lint fix --- models/forgefed/actor_test.go | 3 ++- models/forgefed/nodeinfo.go | 8 ++++---- modules/validation/validatable_test.go | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/models/forgefed/actor_test.go b/models/forgefed/actor_test.go index 6b3cffd710..3b73a6e6b8 100644 --- a/models/forgefed/actor_test.go +++ b/models/forgefed/actor_test.go @@ -178,7 +178,8 @@ func Test_PersonUnmarshalJSON(t *testing.T) { PreferredUsername: ap.NaturalLanguageValues{ ap.LangRefValue{Ref: "en", Value: []byte("MaxMuster")}, }, - }} + }, + } sut := new(ForgePerson) err := sut.UnmarshalJSON([]byte(`{"type":"Person","preferredUsername":"MaxMuster"}`)) if err != nil { diff --git a/models/forgefed/nodeinfo.go b/models/forgefed/nodeinfo.go index 26d24ae6a4..23ce7642f8 100644 --- a/models/forgefed/nodeinfo.go +++ b/models/forgefed/nodeinfo.go @@ -62,19 +62,19 @@ func (node NodeInfoWellKnown) Validate() []string { var result []string result = append(result, validation.ValidateNotEmpty(node.Href, "Href")...) - parsedUrl, err := url.Parse(node.Href) + parsedURL, err := url.Parse(node.Href) if err != nil { result = append(result, err.Error()) return result } - if parsedUrl.Host == "" { + if parsedURL.Host == "" { result = append(result, "Href has to be absolute") } - result = append(result, validation.ValidateOneOf(parsedUrl.Scheme, []any{"http", "https"})...) + result = append(result, validation.ValidateOneOf(parsedURL.Scheme, []any{"http", "https"})...) - if parsedUrl.RawQuery != "" { + if parsedURL.RawQuery != "" { result = append(result, "Href may not contain query") } diff --git a/modules/validation/validatable_test.go b/modules/validation/validatable_test.go index 2a0c46aad5..b86bd20e05 100644 --- a/modules/validation/validatable_test.go +++ b/modules/validation/validatable_test.go @@ -29,7 +29,6 @@ func Test_ValidateNotEmpty_ForTimestamp(t *testing.T) { if res := ValidateNotEmpty(sut, "dummyField"); len(res) > 0 { t.Errorf("sut should be valid but was %q", res) } - } func Test_ValidateMaxLen(t *testing.T) {