From 39d4c8dd2df7d6396ec03da626176ed8fadc2dd5 Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 7 Dec 2023 11:24:27 +0100 Subject: [PATCH] Generalize validate_is_not_empty --- models/activitypub/actor.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/models/activitypub/actor.go b/models/activitypub/actor.go index 23f7fc11be..3e4086d922 100644 --- a/models/activitypub/actor.go +++ b/models/activitypub/actor.go @@ -26,13 +26,10 @@ type ActorID struct { port string // optional } -// ToDo: validate_is_not_empty maybe not as an extra method -func (a ActorID) validate_is_not_empty(str string, field string) error { - +func validate_is_not_empty(str string) error { if str == "" { - return fmt.Errorf("field %v was empty", field) + return fmt.Errorf("the given string was empty") } - return nil }