this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix unnecssary fmt.Sprintf (staticcheck S1039)

Done automatically with `gofmt -w -r "fmt.Sprintf(s) -> s" .`.

authored by

Egon Elbre and committed by
Brian Olson
59538a14 82af8d80

+17 -17
+1 -1
automod/engine/slack.go
··· 86 86 msg += fmt.Sprintf("Report `%s`: %s\n", rep.ReasonType, rep.Comment) 87 87 } 88 88 if newTakedown { 89 - msg += fmt.Sprintf("Takedown!\n") 89 + msg += "Takedown!\n" 90 90 } 91 91 return msg 92 92 }
+1 -1
automod/rules/harassment.go
··· 130 130 131 131 if count > 5 { 132 132 //c.AddRecordFlag("trivial-harassing-post") 133 - c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("possible targetted harassment (also labeled; remove label if this isn't harassment!)")) 133 + c.ReportAccount(automod.ReportReasonOther, "possible targetted harassment (also labeled; remove label if this isn't harassment!)") 134 134 c.AddAccountLabel("!hide") 135 135 c.Notify("slack") 136 136 }
+1 -1
automod/rules/nostr.go
··· 37 37 return nil 38 38 } 39 39 40 - c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("likely nostr spam account (also labeled; remove label if this isn't spam!)")) 40 + c.ReportAccount(automod.ReportReasonOther, "likely nostr spam account (also labeled; remove label if this isn't spam!)") 41 41 c.AddAccountLabel("!hide") 42 42 c.Notify("slack") 43 43 return nil
+1 -1
automod/rules/promo.go
··· 54 54 uniqueReplies := c.GetCountDistinct("reply-to", did, countstore.PeriodDay) 55 55 if uniqueReplies >= 10 { 56 56 c.AddAccountFlag("promo-multi-reply") 57 - c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("possible aggressive self-promotion")) 57 + c.ReportAccount(automod.ReportReasonSpam, "possible aggressive self-promotion") 58 58 c.Notify("slack") 59 59 } 60 60
+2 -2
automod/rules/quick.go
··· 29 29 } 30 30 if strings.Contains(*profile.Description, "🏈🍕🌀") { 31 31 c.AddAccountFlag("profile-bot-string") 32 - c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("possible bot based on string in profile")) 32 + c.ReportAccount(automod.ReportReasonSpam, "possible bot based on string in profile") 33 33 c.Notify("slack") 34 34 return nil 35 35 } ··· 89 89 return nil 90 90 } 91 91 92 - c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("trivial spam account (also labeled; remove label if this isn't spam!)")) 92 + c.ReportAccount(automod.ReportReasonOther, "trivial spam account (also labeled; remove label if this isn't spam!)") 93 93 c.AddAccountLabel("!hide") 94 94 c.Notify("slack") 95 95 return nil
+7 -7
cmd/astrolabe/handlers.go
··· 64 64 65 65 atid, err := syntax.ParseAtIdentifier(c.Param("atid")) 66 66 if err != nil { 67 - return echo.NewHTTPError(404, fmt.Sprintf("failed to parse handle or DID")) 67 + return echo.NewHTTPError(404, "failed to parse handle or DID") 68 68 } 69 69 70 70 ident, err := srv.dir.Lookup(ctx, *atid) ··· 96 96 97 97 atid, err := syntax.ParseAtIdentifier(c.Param("atid")) 98 98 if err != nil { 99 - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse handle or DID")) 99 + return echo.NewHTTPError(400, "failed to parse handle or DID") 100 100 } 101 101 102 102 ident, err := srv.dir.Lookup(ctx, *atid) ··· 133 133 134 134 atid, err := syntax.ParseAtIdentifier(c.Param("atid")) 135 135 if err != nil { 136 - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse handle or DID")) 136 + return echo.NewHTTPError(400, "failed to parse handle or DID") 137 137 } 138 138 139 139 collection, err := syntax.ParseNSID(c.Param("collection")) 140 140 if err != nil { 141 - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse collection NSID")) 141 + return echo.NewHTTPError(400, "failed to parse collection NSID") 142 142 } 143 143 144 144 ident, err := srv.dir.Lookup(ctx, *atid) ··· 191 191 192 192 atid, err := syntax.ParseAtIdentifier(c.Param("atid")) 193 193 if err != nil { 194 - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse handle or DID")) 194 + return echo.NewHTTPError(400, "failed to parse handle or DID") 195 195 } 196 196 197 197 collection, err := syntax.ParseNSID(c.Param("collection")) 198 198 if err != nil { 199 - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse collection NSID")) 199 + return echo.NewHTTPError(400, "failed to parse collection NSID") 200 200 } 201 201 202 202 rkey, err := syntax.ParseRecordKey(c.Param("rkey")) 203 203 if err != nil { 204 - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse record key")) 204 + return echo.NewHTTPError(400, "failed to parse record key") 205 205 } 206 206 207 207 ident, err := srv.dir.Lookup(ctx, *atid)
+1 -1
lex/type_schema.go
··· 223 223 } 224 224 returndef = fmt.Sprintf("(*%s.%s, error)", impname, outname) 225 225 case "application/cbor", "application/vnd.ipld.car", "*/*": 226 - returndef = fmt.Sprintf("(io.Reader, error)") 226 + returndef = "(io.Reader, error)" 227 227 default: 228 228 return fmt.Errorf("unrecognized output encoding (handler stub): %q", s.Output.Encoding) 229 229 }
+2 -2
repomgr/ingest_test.go
··· 208 208 } 209 209 210 210 p1, _, err := repoman.CreateRecord(ctx, 1, "app.bsky.feed.post", &bsky.FeedPost{ 211 - Text: fmt.Sprintf("hello friend"), 211 + Text: "hello friend", 212 212 }) 213 213 if err != nil { 214 214 t.Fatal(err) 215 215 } 216 216 217 217 p2, _, err := repoman.CreateRecord(ctx, 1, "app.bsky.feed.post", &bsky.FeedPost{ 218 - Text: fmt.Sprintf("hello friend"), 218 + Text: "hello friend", 219 219 }) 220 220 if err != nil { 221 221 t.Fatal(err)
+1 -1
search/handlers.go
··· 39 39 if offset > 10000 { 40 40 return 0, 0, &echo.HTTPError{ 41 41 Code: 400, 42 - Message: fmt.Sprintf("invalid value for 'cursor' (can't paginate so deep)"), 42 + Message: "invalid value for 'cursor' (can't paginate so deep)", 43 43 } 44 44 } 45 45