diff --git a/automod/engine/slack.go b/automod/engine/slack.go index ae7c00d2..fe21abb7 100644 --- a/automod/engine/slack.go +++ b/automod/engine/slack.go @@ -86,7 +86,7 @@ func slackBody(header string, acct AccountMeta, newLabels, newFlags []string, ne msg += fmt.Sprintf("Report `%s`: %s\n", rep.ReasonType, rep.Comment) } if newTakedown { - msg += fmt.Sprintf("Takedown!\n") + msg += "Takedown!\n" } return msg } diff --git a/automod/rules/harassment.go b/automod/rules/harassment.go index 2cf7ce19..e38e7c44 100644 --- a/automod/rules/harassment.go +++ b/automod/rules/harassment.go @@ -130,7 +130,7 @@ func HarassmentTrivialPostRule(c *automod.RecordContext, post *appbsky.FeedPost) if count > 5 { //c.AddRecordFlag("trivial-harassing-post") - c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("possible targetted harassment (also labeled; remove label if this isn't harassment!)")) + c.ReportAccount(automod.ReportReasonOther, "possible targetted harassment (also labeled; remove label if this isn't harassment!)") c.AddAccountLabel("!hide") c.Notify("slack") } diff --git a/automod/rules/nostr.go b/automod/rules/nostr.go index 5f91e7ee..f57c5b08 100644 --- a/automod/rules/nostr.go +++ b/automod/rules/nostr.go @@ -37,7 +37,7 @@ func NostrSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error { return nil } - c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("likely nostr spam account (also labeled; remove label if this isn't spam!)")) + c.ReportAccount(automod.ReportReasonOther, "likely nostr spam account (also labeled; remove label if this isn't spam!)") c.AddAccountLabel("!hide") c.Notify("slack") return nil diff --git a/automod/rules/promo.go b/automod/rules/promo.go index f6fe23a2..504119eb 100644 --- a/automod/rules/promo.go +++ b/automod/rules/promo.go @@ -54,7 +54,7 @@ func AggressivePromotionRule(c *automod.RecordContext, post *appbsky.FeedPost) e uniqueReplies := c.GetCountDistinct("reply-to", did, countstore.PeriodDay) if uniqueReplies >= 10 { c.AddAccountFlag("promo-multi-reply") - c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("possible aggressive self-promotion")) + c.ReportAccount(automod.ReportReasonSpam, "possible aggressive self-promotion") c.Notify("slack") } diff --git a/automod/rules/quick.go b/automod/rules/quick.go index ea6a69e3..127914c7 100644 --- a/automod/rules/quick.go +++ b/automod/rules/quick.go @@ -29,7 +29,7 @@ func BotLinkProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) } if strings.Contains(*profile.Description, "🏈🍕🌀") { c.AddAccountFlag("profile-bot-string") - c.ReportAccount(automod.ReportReasonSpam, fmt.Sprintf("possible bot based on string in profile")) + c.ReportAccount(automod.ReportReasonSpam, "possible bot based on string in profile") c.Notify("slack") return nil } @@ -89,7 +89,7 @@ func TrivialSpamPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error return nil } - c.ReportAccount(automod.ReportReasonOther, fmt.Sprintf("trivial spam account (also labeled; remove label if this isn't spam!)")) + c.ReportAccount(automod.ReportReasonOther, "trivial spam account (also labeled; remove label if this isn't spam!)") c.AddAccountLabel("!hide") c.Notify("slack") return nil diff --git a/cmd/astrolabe/handlers.go b/cmd/astrolabe/handlers.go index 4a735e8e..f7732fe4 100644 --- a/cmd/astrolabe/handlers.go +++ b/cmd/astrolabe/handlers.go @@ -64,7 +64,7 @@ func (srv *Server) WebAccount(c echo.Context) error { atid, err := syntax.ParseAtIdentifier(c.Param("atid")) if err != nil { - return echo.NewHTTPError(404, fmt.Sprintf("failed to parse handle or DID")) + return echo.NewHTTPError(404, "failed to parse handle or DID") } ident, err := srv.dir.Lookup(ctx, *atid) @@ -96,7 +96,7 @@ func (srv *Server) WebRepo(c echo.Context) error { atid, err := syntax.ParseAtIdentifier(c.Param("atid")) if err != nil { - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse handle or DID")) + return echo.NewHTTPError(400, "failed to parse handle or DID") } ident, err := srv.dir.Lookup(ctx, *atid) @@ -133,12 +133,12 @@ func (srv *Server) WebRepoCollection(c echo.Context) error { atid, err := syntax.ParseAtIdentifier(c.Param("atid")) if err != nil { - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse handle or DID")) + return echo.NewHTTPError(400, "failed to parse handle or DID") } collection, err := syntax.ParseNSID(c.Param("collection")) if err != nil { - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse collection NSID")) + return echo.NewHTTPError(400, "failed to parse collection NSID") } ident, err := srv.dir.Lookup(ctx, *atid) @@ -191,17 +191,17 @@ func (srv *Server) WebRepoRecord(c echo.Context) error { atid, err := syntax.ParseAtIdentifier(c.Param("atid")) if err != nil { - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse handle or DID")) + return echo.NewHTTPError(400, "failed to parse handle or DID") } collection, err := syntax.ParseNSID(c.Param("collection")) if err != nil { - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse collection NSID")) + return echo.NewHTTPError(400, "failed to parse collection NSID") } rkey, err := syntax.ParseRecordKey(c.Param("rkey")) if err != nil { - return echo.NewHTTPError(400, fmt.Sprintf("failed to parse record key")) + return echo.NewHTTPError(400, "failed to parse record key") } ident, err := srv.dir.Lookup(ctx, *atid) diff --git a/lex/type_schema.go b/lex/type_schema.go index fcec3575..62c5e670 100644 --- a/lex/type_schema.go +++ b/lex/type_schema.go @@ -223,7 +223,7 @@ func (s *TypeSchema) WriteHandlerStub(w io.Writer, fname, shortname, impname str } returndef = fmt.Sprintf("(*%s.%s, error)", impname, outname) case "application/cbor", "application/vnd.ipld.car", "*/*": - returndef = fmt.Sprintf("(io.Reader, error)") + returndef = "(io.Reader, error)" default: return fmt.Errorf("unrecognized output encoding (handler stub): %q", s.Output.Encoding) } diff --git a/repomgr/ingest_test.go b/repomgr/ingest_test.go index 38a8562e..03444b9f 100644 --- a/repomgr/ingest_test.go +++ b/repomgr/ingest_test.go @@ -208,14 +208,14 @@ func TestDuplicateRecord(t *testing.T) { } p1, _, err := repoman.CreateRecord(ctx, 1, "app.bsky.feed.post", &bsky.FeedPost{ - Text: fmt.Sprintf("hello friend"), + Text: "hello friend", }) if err != nil { t.Fatal(err) } p2, _, err := repoman.CreateRecord(ctx, 1, "app.bsky.feed.post", &bsky.FeedPost{ - Text: fmt.Sprintf("hello friend"), + Text: "hello friend", }) if err != nil { t.Fatal(err) diff --git a/search/handlers.go b/search/handlers.go index 735080db..a5d2b27c 100644 --- a/search/handlers.go +++ b/search/handlers.go @@ -39,7 +39,7 @@ func parseCursorLimit(e echo.Context) (int, int, error) { if offset > 10000 { return 0, 0, &echo.HTTPError{ Code: 400, - Message: fmt.Sprintf("invalid value for 'cursor' (can't paginate so deep)"), + Message: "invalid value for 'cursor' (can't paginate so deep)", } }