From 364838c11bb52aac5a13942088ef42b0d9fcaeb1 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Mon, 9 May 2022 19:10:45 -0500 Subject: [PATCH] Fix lint errors --- modules/activitypub/main_test.go | 3 ++- routers/api/v1/activitypub/person.go | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/activitypub/main_test.go b/modules/activitypub/main_test.go index 4410fca27b..289bc9f32b 100644 --- a/modules/activitypub/main_test.go +++ b/modules/activitypub/main_test.go @@ -12,5 +12,6 @@ import ( ) func TestMain(m *testing.M) { - unittest.MainTest(m, filepath.Join("..", "..")) + testOps := unittest.TestOptions{GiteaRootPath: filepath.Join("..", "..")} + unittest.MainTest(m, &testOps) } diff --git a/routers/api/v1/activitypub/person.go b/routers/api/v1/activitypub/person.go index 9df834dd4d..7b9b238177 100644 --- a/routers/api/v1/activitypub/person.go +++ b/routers/api/v1/activitypub/person.go @@ -76,12 +76,12 @@ func Person(ctx *context.APIContext) { publicKeyType.SetW3IDSecurityV1Owner(ownerProp) publicKeyPemProp := streams.NewW3IDSecurityV1PublicKeyPemProperty() - if publicKeyPem, err := activitypub.GetPublicKey(user); err != nil { + publicKeyPem, err := activitypub.GetPublicKey(user) + if err != nil { ctx.Error(http.StatusInternalServerError, "GetPublicKey", err) return - } else { - publicKeyPemProp.Set(publicKeyPem) } + publicKeyPemProp.Set(publicKeyPem) publicKeyType.SetW3IDSecurityV1PublicKeyPem(publicKeyPemProp) publicKeyProp.AppendW3IDSecurityV1PublicKey(publicKeyType)