aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorluzpaz <luzpaz@users.noreply.github.com>2022-07-12 17:32:37 -0400
committerGitHub <noreply@github.com>2022-07-12 23:32:37 +0200
commitd29d6d1991496cc688e9418db4960ca945fd9d6b (patch)
tree878dcc8a2c8621f9328d5093c6003d664d6fe9ed /modules
parent966e7bdc9b875abb7192cd572beec40123a815da (diff)
downloadgitea-d29d6d1991496cc688e9418db4960ca945fd9d6b.tar.gz
gitea-d29d6d1991496cc688e9418db4960ca945fd9d6b.zip
Fix various typos (#20338)
* Fix various typos Found via `codespell -q 3 -S ./options/locale,./options/license,./public/vendor -L actived,allways,attachements,ba,befores,commiter,pullrequest,pullrequests,readby,splitted,te,unknwon` Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/charset/charset.go6
-rw-r--r--modules/doctor/breaking.go4
-rw-r--r--modules/nosql/manager_leveldb.go2
-rw-r--r--modules/web/middleware/locale.go2
-rw-r--r--modules/web/routing/context.go2
5 files changed, 8 insertions, 8 deletions
diff --git a/modules/charset/charset.go b/modules/charset/charset.go
index 89bbf1f8c9..a1210d2f05 100644
--- a/modules/charset/charset.go
+++ b/modules/charset/charset.go
@@ -23,7 +23,7 @@ import (
// UTF8BOM is the utf-8 byte-order marker
var UTF8BOM = []byte{'\xef', '\xbb', '\xbf'}
-// ToUTF8WithFallbackReader detects the encoding of content and coverts to UTF-8 reader if possible
+// ToUTF8WithFallbackReader detects the encoding of content and converts to UTF-8 reader if possible
func ToUTF8WithFallbackReader(rd io.Reader) io.Reader {
buf := make([]byte, 2048)
n, err := util.ReadAtMost(rd, buf)
@@ -76,7 +76,7 @@ func ToUTF8WithErr(content []byte) (string, error) {
return string(result), err
}
-// ToUTF8WithFallback detects the encoding of content and coverts to UTF-8 if possible
+// ToUTF8WithFallback detects the encoding of content and converts to UTF-8 if possible
func ToUTF8WithFallback(content []byte) []byte {
bs, _ := io.ReadAll(ToUTF8WithFallbackReader(bytes.NewReader(content)))
return bs
@@ -191,7 +191,7 @@ func DetectEncoding(content []byte) (string, error) {
break
}
- // Otherwise check if this results is earlier in the DetectedCharsetOrder than our current top guesss
+ // Otherwise check if this results is earlier in the DetectedCharsetOrder than our current top guess
resultPriority, resultHas := setting.Repository.DetectedCharsetScore[strings.ToLower(strings.TrimSpace(result.Charset))]
if resultHas && (!has || resultPriority < priority) {
topResult = result
diff --git a/modules/doctor/breaking.go b/modules/doctor/breaking.go
index 3e01d97d7c..391c8e76c5 100644
--- a/modules/doctor/breaking.go
+++ b/modules/doctor/breaking.go
@@ -32,8 +32,8 @@ func iterateUserAccounts(ctx context.Context, each func(*user.User) error) error
// Ref: https://github.com/go-gitea/gitea/pull/19085 & https://github.com/go-gitea/gitea/pull/17688
func checkUserEmail(ctx context.Context, logger log.Logger, _ bool) error {
// We could use quirky SQL to get all users that start without a [a-zA-Z0-9], but that would mean
- // DB provider-specific SQL and only works _now_. So instead we iterate trough all user accounts and
- // use the user.ValidateEmail function to be future-proof.
+ // DB provider-specific SQL and only works _now_. So instead we iterate through all user accounts
+ // and use the user.ValidateEmail function to be future-proof.
var invalidUserCount int64
if err := iterateUserAccounts(ctx, func(u *user.User) error {
// Only check for users, skip
diff --git a/modules/nosql/manager_leveldb.go b/modules/nosql/manager_leveldb.go
index d356a79bf8..7539952cf1 100644
--- a/modules/nosql/manager_leveldb.go
+++ b/modules/nosql/manager_leveldb.go
@@ -103,7 +103,7 @@ func (m *Manager) getLevelDB(connection string) (*leveldb.DB, error) {
db, ok = m.LevelDBConnections[dataDir]
if ok {
db.count++
- log.Warn("Duplicate connnection to level db: %s with different connection strings. Initial connection: %s. This connection: %s", dataDir, db.name[0], connection)
+ log.Warn("Duplicate connection to level db: %s with different connection strings. Initial connection: %s. This connection: %s", dataDir, db.name[0], connection)
db.name = append(db.name, connection)
m.LevelDBConnections[connection] = db
return db.db, nil
diff --git a/modules/web/middleware/locale.go b/modules/web/middleware/locale.go
index de8e497965..f4018527c0 100644
--- a/modules/web/middleware/locale.go
+++ b/modules/web/middleware/locale.go
@@ -60,7 +60,7 @@ func SetLocaleCookie(resp http.ResponseWriter, lang string, expiry int) {
}
// DeleteLocaleCookie convenience function to delete the locale cookie consistently
-// Setting the lang cookie will trigger the middleware to reset the language ot previous state.
+// Setting the lang cookie will trigger the middleware to reset the language to previous state.
func DeleteLocaleCookie(resp http.ResponseWriter) {
SetCookie(resp, "lang", "",
-1,
diff --git a/modules/web/routing/context.go b/modules/web/routing/context.go
index d3c7759e64..7e263db5a2 100644
--- a/modules/web/routing/context.go
+++ b/modules/web/routing/context.go
@@ -25,7 +25,7 @@ func UpdateFuncInfo(ctx context.Context, funcInfo *FuncInfo) {
record.lock.Unlock()
}
-// MarkLongPolling marks the reuqest is a long-polling request, and the logger may output different message for it
+// MarkLongPolling marks the request is a long-polling request, and the logger may output different message for it
func MarkLongPolling(resp http.ResponseWriter, req *http.Request) {
record, ok := req.Context().Value(contextKey).(*requestRecord)
if !ok {