diff --git a/models/repo/repo_repository.go b/models/repo/repo_repository.go index 5111cfaf22..a814279f8c 100644 --- a/models/repo/repo_repository.go +++ b/models/repo/repo_repository.go @@ -57,7 +57,7 @@ func CreateFederatedRepo(ctx context.Context, repo *FederatedRepo) error { func UpdateFederatedRepo(ctx context.Context, localRepoId int64, federatedRepoList []*FederatedRepo) error { for _, federatedRepo := range federatedRepoList { - if res, err := validation.IsValid(federatedRepo); !res { + if res, err := validation.IsValid(*federatedRepo); !res { return fmt.Errorf("FederationInfo is not valid: %v", err) } } diff --git a/modules/forgefed/federation_service.go b/modules/forgefed/federation_service.go index 93d73064a6..e4427106cf 100644 --- a/modules/forgefed/federation_service.go +++ b/modules/forgefed/federation_service.go @@ -213,7 +213,7 @@ func CreateUserFromAP(ctx context.Context, personID forgefed.PersonID, federatio // Create or update a list of FederatedRepo structs func UpdateFederatedRepoList(ctx context.Context, localRepoId int64, federatedRepoList []string) (int, string, error) { - federatedRepos := make([]*repo.FederatedRepo, len(federatedRepoList)) + federatedRepos := make([]*repo.FederatedRepo, 0, len(federatedRepoList)) for _, uri := range federatedRepoList { federationHost, err := GetFederationHostForUri(ctx, uri) if err != nil {