Vow, uncensorable PDS written in Go

fix: empty array nil (#66)

* fix: empty array nil

* use make for array init

---------

Co-authored-by: Hailey <me@haileyok.com>

authored by shi.gg

Hailey and committed by
GitHub
95858499 484fb48c

+4 -4
+1 -1
server/handle_repo_list_repos.go
··· 28 28 return err 29 29 } 30 30 31 - var items []ComAtprotoSyncListReposRepoItem 31 + items := make([]ComAtprotoSyncListReposRepoItem, 0, len(repos)) 32 32 for _, r := range repos { 33 33 c, err := cid.Cast(r.Root) 34 34 if err != nil {
+2 -2
server/handle_server_create_invite_codes.go
··· 44 44 req.ForAccounts = to.StringSlicePtr([]string{"admin"}) 45 45 } 46 46 47 - var codes []ComAtprotoServerCreateInviteCodesItem 47 + codes := make([]ComAtprotoServerCreateInviteCodesItem, 0, len(*req.ForAccounts)) 48 48 49 49 for _, did := range *req.ForAccounts { 50 - var ics []string 50 + ics := make([]string, 0, *req.CodeCount) 51 51 52 52 for range *req.CodeCount { 53 53 ic := uuid.NewString()
+1 -1
server/handle_sync_list_blobs.go
··· 57 57 return helpers.ServerError(e, nil) 58 58 } 59 59 60 - var cstrs []string 60 + cstrs := make([]string, 0, len(blobs)) 61 61 for _, b := range blobs { 62 62 if len(b.Cid) == 0 { 63 63 logger.Error("empty cid found", "blob", b)