From 27c9db1027a3d11d7084df5ebc5e4fb8903bd231 Mon Sep 17 00:00:00 2001 From: erik Date: Wed, 6 Dec 2023 11:24:42 +0100 Subject: [PATCH] Better function descriptions --- models/activitypub/actor.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/models/activitypub/actor.go b/models/activitypub/actor.go index bb2ada5964..abc0d3e99d 100644 --- a/models/activitypub/actor.go +++ b/models/activitypub/actor.go @@ -37,7 +37,7 @@ func (a ActorID) validate_is_not_empty(str string, field string) error { } /* -Validate collects error strings, concatenates and returns them +Validate collects error strings in a slice and returns this */ func (a ActorID) Validate() []string { @@ -64,6 +64,9 @@ func (a ActorID) Validate() []string { } +/* +IsValid concatenates the error messages with newlines and returns them if there are any +*/ func (a ActorID) IsValid() (bool, error) { if err := a.Validate(); len(err) > 0 { errString := strings.Join(err, "\n") @@ -88,7 +91,7 @@ func (a ActorID) GetUserId() int { return result } -func (a ActorID) GetNormailzedUri() string { +func (a ActorID) GetNormailzedUri() string { // ToDo: Port might be empty result := fmt.Sprintf("%s://%s:%s/%s/%s", a.schema, a.host, a.port, a.path, a.userId) return result }