An atproto PDS written in Go

nitpicks from yesterday's changes (#9)

* µopt: only do one allocation here

* just check if preferences is a key of the prefs obj

i think json.Unmarshal can give u a non-nil guy here and checking for
nil or empty is kinda cringe so let's just do this

+1 -1
server/handle_actor_get_preferences.go
···
var prefs map[string]any
err := json.Unmarshal(repo.Preferences, &prefs)
-
if err != nil || prefs == nil {
+
if err != nil || prefs["preferences"] == nil {
prefs = map[string]any{
"preferences": map[string]any{},
}
+1 -1
server/handle_repo_describe_repo.go
···
return helpers.ServerError(e, nil)
}
-
var collections []string = make([]string, 0)
+
var collections []string = make([]string, 0, len(records))
for _, r := range records {
collections = append(collections, r.Nsid)
}