From 04c4552a9c3f9179653676487750adef1ddeed0f Mon Sep 17 00:00:00 2001 From: Gokul Menon Date: Mon, 28 Feb 2022 14:19:50 +0100 Subject: [PATCH] Fixed typos --- cmd/bounce.go | 2 +- cmd/campaigns.go | 4 ++-- cmd/handlers.go | 2 +- cmd/queries.go | 4 ++-- cmd/upgrade.go | 2 +- cmd/utils.go | 4 ++-- internal/i18n/i18n.go | 4 ++-- internal/messenger/email/email.go | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/cmd/bounce.go b/cmd/bounce.go index 2ce6179..e7005df 100644 --- a/cmd/bounce.go +++ b/cmd/bounce.go @@ -147,7 +147,7 @@ func handleBounceWebhook(c echo.Context) error { bounces []models.Bounce ) - // Read the request body instead of using using c.Bind() to read to save the entire raw request as meta. + // Read the request body instead of using c.Bind() to read to save the entire raw request as meta. rawReq, err := ioutil.ReadAll(c.Request().Body) if err != nil { app.log.Printf("error reading ses notification body: %v", err) diff --git a/cmd/campaigns.go b/cmd/campaigns.go index dd781a5..9ee1e03 100644 --- a/cmd/campaigns.go +++ b/cmd/campaigns.go @@ -22,7 +22,7 @@ import ( ) // campaignReq is a wrapper over the Campaign model for receiving -// campaign creation and updation data from APIs. +// campaign creation and update data from APIs. type campaignReq struct { models.Campaign @@ -346,7 +346,7 @@ func handleUpdateCampaign(c echo.Context) error { } // Read the incoming params into the existing campaign fields from the DB. - // This allows updating of values that have been sent where as fields + // This allows updating of values that have been sent whereas fields // that are not in the request retain the old values. o := campaignReq{Campaign: cm} if err := c.Bind(&o); err != nil { diff --git a/cmd/handlers.go b/cmd/handlers.go index 63c6ba1..1544818 100644 --- a/cmd/handlers.go +++ b/cmd/handlers.go @@ -189,7 +189,7 @@ func handleHealthCheck(c echo.Context) error { return c.JSON(http.StatusOK, okResp{true}) } -// serveCustomApperance serves the given custom CSS/JS apperance blob +// serveCustomApperance serves the given custom CSS/JS appearance blob // meant for customizing public and admin pages from the admin settings UI. func serveCustomApperance(name string) echo.HandlerFunc { return func(c echo.Context) error { diff --git a/cmd/queries.go b/cmd/queries.go index 90c6a9b..9d06636 100644 --- a/cmd/queries.go +++ b/cmd/queries.go @@ -121,7 +121,7 @@ func connectDB(c dbConf) (*sqlx.DB, error) { return db, nil } -// compileSubscriberQueryTpl takes a arbitrary WHERE expressions +// compileSubscriberQueryTpl takes an arbitrary WHERE expressions // to filter subscribers from the subscribers table and prepares a query // out of it using the raw `query-subscribers-template` query template. // While doing this, a readonly transaction is created and the query is @@ -145,7 +145,7 @@ func (q *Queries) compileSubscriberQueryTpl(exp string, db *sqlx.DB) (string, er return stmt, nil } -// compileSubscriberQueryTpl takes a arbitrary WHERE expressions and a subscriber +// compileSubscriberQueryTpl takes an arbitrary WHERE expressions and a subscriber // query template that depends on the filter (eg: delete by query, blocklist by query etc.) // combines and executes them. func (q *Queries) execSubscriberQueryTpl(exp, tpl string, listIDs []int64, db *sqlx.DB, args ...interface{}) error { diff --git a/cmd/upgrade.go b/cmd/upgrade.go index 46b590a..1b49a25 100644 --- a/cmd/upgrade.go +++ b/cmd/upgrade.go @@ -112,7 +112,7 @@ func getPendingMigrations(db *sqlx.DB) (string, []migFunc, error) { } // Iterate through the migration versions and get everything above the last - // last upgraded semver. + // upgraded semver. var toRun []migFunc for i, m := range migList { if semver.Compare(m.version, lastVer) > 0 { diff --git a/cmd/utils.go b/cmd/utils.go index 381f4c8..08c3278 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -49,7 +49,7 @@ func pqErrMsg(err error) string { } // normalizeTags takes a list of string tags and normalizes them by -// lowercasing and removing all special characters except for dashes. +// lower casing and removing all special characters except for dashes. func normalizeTags(tags []string) []string { var ( out []string @@ -67,7 +67,7 @@ func normalizeTags(tags []string) []string { } // makeMsgTpl takes a page title, heading, and message and returns -// a msgTpl that can be rendered as a HTML view. This is used for +// a msgTpl that can be rendered as an HTML view. This is used for // rendering arbitrary HTML views with error and success messages. func makeMsgTpl(pageTitle, heading, msg string) msgTpl { if heading == "" { diff --git a/internal/i18n/i18n.go b/internal/i18n/i18n.go index c22b4b5..d607068 100644 --- a/internal/i18n/i18n.go +++ b/internal/i18n/i18n.go @@ -1,6 +1,6 @@ // i18n is a simple package that translates strings using a language map. // It mimicks some functionality of the vue-i18n library so that the same JSON -// language map may be used in the JS frontent and the Go backend. +// language map may be used in the JS frontend and the Go backend. package i18n import ( @@ -85,7 +85,7 @@ func (i *I18n) T(key string) string { } // Ts returns the translation for the given key similar to vue i18n's t() -// and subsitutes the params in the given map in the translated value. +// and substitutes the params in the given map in the translated value. // In the language values, the substitutions are represented as: {key} // The params and values are received as a pairs of succeeding strings. // That is, the number of these arguments should be an even number. diff --git a/internal/messenger/email/email.go b/internal/messenger/email/email.go index 55d8809..cbbd513 100644 --- a/internal/messenger/email/email.go +++ b/internal/messenger/email/email.go @@ -34,7 +34,7 @@ type Emailer struct { servers []*Server } -// New returns an SMTP e-mail Messenger backend with a the given SMTP servers. +// New returns an SMTP e-mail Messenger backend with the given SMTP servers. func New(servers ...Server) (*Emailer, error) { e := &Emailer{ servers: make([]*Server, 0, len(servers)),