diff options
author | Ryan W <twentybitdev@gmail.com> | 2021-09-08 17:31:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-08 17:31:03 +0100 |
commit | a624eab309ee6ee7b3540dfba884a42c9a4f4ad9 (patch) | |
tree | 92ec39ba2d0f512891dcb20635ee9bc660b45b18 /internal | |
parent | 7dc8fb1fe780888d5758bf665949e9e09d21e56a (diff) |
- Removed double imports (#1989)
- Lower cased error messages
Signed-off-by: Ryan Whittington <twentybitdev@gmail.com>
Co-authored-by: kegsay <kegan@matrix.org>
Diffstat (limited to 'internal')
-rw-r--r-- | internal/eventutil/events.go | 2 | ||||
-rw-r--r-- | internal/httputil/http.go | 4 | ||||
-rw-r--r-- | internal/sqlutil/migrate.go | 10 | ||||
-rw-r--r-- | internal/sqlutil/sql.go | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/internal/eventutil/events.go b/internal/eventutil/events.go index b8691c50..47c83d51 100644 --- a/internal/eventutil/events.go +++ b/internal/eventutil/events.go @@ -28,7 +28,7 @@ import ( // ErrRoomNoExists is returned when trying to lookup the state of a room that // doesn't exist -var ErrRoomNoExists = errors.New("Room does not exist") +var ErrRoomNoExists = errors.New("room does not exist") // QueryAndBuildEvent builds a Matrix event using the event builder and roomserver query // API client provided. If also fills roomserver query API response (if provided) diff --git a/internal/httputil/http.go b/internal/httputil/http.go index 9197371a..a469c8ac 100644 --- a/internal/httputil/http.go +++ b/internal/httputil/http.go @@ -73,9 +73,9 @@ func PostJSON( Message string `json:"message"` } if msgerr := json.NewDecoder(res.Body).Decode(&errorBody); msgerr == nil { - return fmt.Errorf("Internal API: %d from %s: %s", res.StatusCode, apiURL, errorBody.Message) + return fmt.Errorf("internal API: %d from %s: %s", res.StatusCode, apiURL, errorBody.Message) } - return fmt.Errorf("Internal API: %d from %s", res.StatusCode, apiURL) + return fmt.Errorf("internal API: %d from %s", res.StatusCode, apiURL) } return json.NewDecoder(res.Body).Decode(response) } diff --git a/internal/sqlutil/migrate.go b/internal/sqlutil/migrate.go index 62b1c8fa..7518df3c 100644 --- a/internal/sqlutil/migrate.go +++ b/internal/sqlutil/migrate.go @@ -46,7 +46,7 @@ func (m *Migrations) RunDeltas(db *sql.DB, props *config.DatabaseOptions) error minVer := int64(0) migrations, err := m.collect(minVer, maxVer) if err != nil { - return fmt.Errorf("RunDeltas: Failed to collect migrations: %w", err) + return fmt.Errorf("runDeltas: Failed to collect migrations: %w", err) } if props.ConnectionString.IsPostgres() { if err = goose.SetDialect("postgres"); err != nil { @@ -57,12 +57,12 @@ func (m *Migrations) RunDeltas(db *sql.DB, props *config.DatabaseOptions) error return err } } else { - return fmt.Errorf("Unknown connection string: %s", props.ConnectionString) + return fmt.Errorf("unknown connection string: %s", props.ConnectionString) } for { current, err := goose.EnsureDBVersion(db) if err != nil { - return fmt.Errorf("RunDeltas: Failed to EnsureDBVersion: %w", err) + return fmt.Errorf("runDeltas: Failed to EnsureDBVersion: %w", err) } next, err := migrations.Next(current) @@ -71,11 +71,11 @@ func (m *Migrations) RunDeltas(db *sql.DB, props *config.DatabaseOptions) error return nil } - return fmt.Errorf("RunDeltas: Failed to load next migration to %+v : %w", next, err) + return fmt.Errorf("runDeltas: Failed to load next migration to %+v : %w", next, err) } if err = next.Up(db); err != nil { - return fmt.Errorf("RunDeltas: Failed run migration: %w", err) + return fmt.Errorf("runDeltas: Failed run migration: %w", err) } } } diff --git a/internal/sqlutil/sql.go b/internal/sqlutil/sql.go index 98cc396a..8d0d2dfa 100644 --- a/internal/sqlutil/sql.go +++ b/internal/sqlutil/sql.go @@ -25,7 +25,7 @@ import ( ) // ErrUserExists is returned if a username already exists in the database. -var ErrUserExists = errors.New("Username already exists") +var ErrUserExists = errors.New("username already exists") // A Transaction is something that can be committed or rolledback. type Transaction interface { |