From 6f9ac80c39ed5976665d38b67344b38d2297c581 Mon Sep 17 00:00:00 2001 From: mstar Date: Mon, 7 Apr 2025 15:02:23 +0200 Subject: [PATCH] Remove one pointer too many --- parser.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/parser.go b/parser.go index 4f5ed05..8af6b5c 100644 --- a/parser.go +++ b/parser.go @@ -139,7 +139,7 @@ func UnmarshalPreprocessed( // Find an attribute in an ActivityPub object of the given type // Returns a pointer to the found attribute and whether it found it // 2nd parameter is true if the attribute was found, false otherwise -func FindAttribute[T BaseApChain](object BaseApChain) (*T, bool) { +func FindAttribute[T BaseApChain](object BaseApChain) (T, bool) { var obj T var ok bool // Try and cast object into wanted type @@ -150,8 +150,8 @@ func FindAttribute[T BaseApChain](object BaseApChain) (*T, bool) { object, ok = object.GetSelfOrBase() // If this is the final object in the chain, cancel and return false if !ok { - return nil, false + return obj, false } } - return &obj, true + return obj, true }