a little more type safety with less interface

This commit is contained in:
Ted Unangst 2019-07-28 20:01:12 -04:00
parent a6b45e4c92
commit d6cc646200
2 changed files with 5 additions and 5 deletions

View File

@ -785,7 +785,7 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
jo["sensitive"] = true jo["sensitive"] = true
} }
var tags []interface{} var tags []junk.Junk
g := bunchofgrapes(h.Noise) g := bunchofgrapes(h.Noise)
for _, m := range g { for _, m := range g {
t := junk.New() t := junk.New()
@ -817,7 +817,7 @@ func jonkjonk(user *WhatAbout, h *Honk) (junk.Junk, junk.Junk) {
if len(tags) > 0 { if len(tags) > 0 {
jo["tag"] = tags jo["tag"] = tags
} }
var atts []interface{} var atts []junk.Junk
for _, d := range h.Donks { for _, d := range h.Donks {
if re_emus.MatchString(d.Name) { if re_emus.MatchString(d.Name) {
continue continue

View File

@ -499,7 +499,7 @@ func outbox(w http.ResponseWriter, r *http.Request) {
honks := gethonksbyuser(name, false) honks := gethonksbyuser(name, false)
var jonks []map[string]interface{} var jonks []junk.Junk
for _, h := range honks { for _, h := range honks {
j, _ := jonkjonk(user, h) j, _ := jonkjonk(user, h)
jonks = append(jonks, j) jonks = append(jonks, j)
@ -532,7 +532,7 @@ func emptiness(w http.ResponseWriter, r *http.Request) {
j["id"] = user.URL + colname j["id"] = user.URL + colname
j["type"] = "OrderedCollection" j["type"] = "OrderedCollection"
j["totalItems"] = 0 j["totalItems"] = 0
j["orderedItems"] = []interface{}{} j["orderedItems"] = []junk.Junk{}
w.Header().Set("Content-Type", theonetruename) w.Header().Set("Content-Type", theonetruename)
j.Write(w) j.Write(w)
@ -1350,7 +1350,7 @@ func fingerlicker(w http.ResponseWriter, r *http.Request) {
j := junk.New() j := junk.New()
j["subject"] = fmt.Sprintf("acct:%s@%s", user.Name, serverName) j["subject"] = fmt.Sprintf("acct:%s@%s", user.Name, serverName)
j["aliases"] = []string{user.URL} j["aliases"] = []string{user.URL}
var links []map[string]interface{} var links []junk.Junk
l := junk.New() l := junk.New()
l["rel"] = "self" l["rel"] = "self"
l["type"] = `application/activity+json` l["type"] = `application/activity+json`