Skip to content

Commit e90175a

Browse files
[+] bump golangci/golangci-lint-action from 6 to 7 (#8)
* Bump golangci/golangci-lint-action from 6 to 7 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6 to 7. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@v6...v7) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * fix ST1005: error strings should not be capitalized (staticcheck) --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Pavlo Golub <[email protected]>
1 parent 6aa8e72 commit e90175a

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
go version
2929
3030
- name: GolangCI-Lint
31-
uses: golangci/golangci-lint-action@v6
31+
uses: golangci/golangci-lint-action@v7
3232
with:
3333
version: latest
3434

migrator.go

+9-9
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ func New(opts ...Option) (*Migrator, error) {
6363
}
6464

6565
if len(m.migrations) == 0 {
66-
return nil, errors.New("Migrations must be provided")
66+
return nil, errors.New("migrations must be provided")
6767
}
6868

6969
for _, m := range m.migrations {
7070
switch m.(type) {
7171
case *Migration:
7272
case *MigrationNoTx:
7373
default:
74-
return nil, errors.New("Invalid migration type")
74+
return nil, errors.New("invalid migration type")
7575
}
7676
}
7777

@@ -103,11 +103,11 @@ func (m *Migrator) Migrate(ctx context.Context, db PgxIface) error {
103103
switch mm := migration.(type) {
104104
case *Migration:
105105
if err := migrate(ctx, db, insertVersion, mm, m.onNotice); err != nil {
106-
return fmt.Errorf("Error while running migrations: %w", err)
106+
return fmt.Errorf("error while running migrations: %w", err)
107107
}
108108
case *MigrationNoTx:
109109
if err := migrateNoTx(ctx, db, insertVersion, mm, m.onNotice); err != nil {
110-
return fmt.Errorf("Error while running migrations: %w", err)
110+
return fmt.Errorf("error while running migrations: %w", err)
111111
}
112112
}
113113
}
@@ -185,18 +185,18 @@ func migrate(ctx context.Context, db PgxIface, insertVersion string, migration *
185185
defer func() {
186186
if err != nil {
187187
if errRb := tx.Rollback(ctx); errRb != nil {
188-
err = fmt.Errorf("Error rolling back: %s\n%s", errRb, err)
188+
err = fmt.Errorf("error rolling back: %s\n%s", errRb, err)
189189
}
190190
return
191191
}
192192
err = tx.Commit(ctx)
193193
}()
194194
notice(fmt.Sprintf("Applying migration named '%s'...", migration.Name))
195195
if err = migration.Func(ctx, tx); err != nil {
196-
return fmt.Errorf("Error executing golang migration: %w", err)
196+
return fmt.Errorf("error executing golang migration: %w", err)
197197
}
198198
if _, err = tx.Exec(ctx, insertVersion); err != nil {
199-
return fmt.Errorf("Error updating migration versions: %w", err)
199+
return fmt.Errorf("error updating migration versions: %w", err)
200200
}
201201
notice(fmt.Sprintf("Applied migration named '%s'", migration.Name))
202202

@@ -206,10 +206,10 @@ func migrate(ctx context.Context, db PgxIface, insertVersion string, migration *
206206
func migrateNoTx(ctx context.Context, db PgxIface, insertVersion string, migration *MigrationNoTx, notice func(string)) error {
207207
notice(fmt.Sprintf("Applying no tx migration named '%s'...", migration.Name))
208208
if err := migration.Func(ctx, db); err != nil {
209-
return fmt.Errorf("Error executing golang migration: %w", err)
209+
return fmt.Errorf("error executing golang migration: %w", err)
210210
}
211211
if _, err := db.Exec(ctx, insertVersion); err != nil {
212-
return fmt.Errorf("Error updating migration versions: %w", err)
212+
return fmt.Errorf("error updating migration versions: %w", err)
213213
}
214214
notice(fmt.Sprintf("Applied no tx migration named '%s'...", migration.Name))
215215

0 commit comments

Comments
 (0)