a little more type safety with less interface
Ted Unangst tedu@tedunangst.com
Sun, 28 Jul 2019 20:01:12 -0400
2 files changed,
5 insertions(+),
5 deletions(-)
M
activity.go
→
activity.go
@@ -785,7 +785,7 @@ jo["summary"] = peppers
jo["sensitive"] = true } - var tags []interface{} + var tags []junk.Junk g := bunchofgrapes(h.Noise) for _, m := range g { t := junk.New()@@ -817,7 +817,7 @@ }
if len(tags) > 0 { jo["tag"] = tags } - var atts []interface{} + var atts []junk.Junk for _, d := range h.Donks { if re_emus.MatchString(d.Name) { continue
M
honk.go
→
honk.go
@@ -499,7 +499,7 @@ }
honks := gethonksbyuser(name, false) - var jonks []map[string]interface{} + var jonks []junk.Junk for _, h := range honks { j, _ := jonkjonk(user, h) jonks = append(jonks, j)@@ -532,7 +532,7 @@ j["@context"] = itiswhatitis
j["id"] = user.URL + colname j["type"] = "OrderedCollection" j["totalItems"] = 0 - j["orderedItems"] = []interface{}{} + j["orderedItems"] = []junk.Junk{} w.Header().Set("Content-Type", theonetruename) j.Write(w)@@ -1350,7 +1350,7 @@
j := junk.New() j["subject"] = fmt.Sprintf("acct:%s@%s", user.Name, serverName) j["aliases"] = []string{user.URL} - var links []map[string]interface{} + var links []junk.Junk l := junk.New() l["rel"] = "self" l["type"] = `application/activity+json`