From bce02749be3c1182bfb531e18d057b4087a574fc Mon Sep 17 00:00:00 2001 From: Cyrille Hemidy Date: Wed, 13 Mar 2019 19:34:58 +0100 Subject: [PATCH 1/2] fix gofmt -s --- database/ql/ql.go | 1 + 1 file changed, 1 insertion(+) diff --git a/database/ql/ql.go b/database/ql/ql.go index 6dfd202a1..d8c45a14d 100644 --- a/database/ql/ql.go +++ b/database/ql/ql.go @@ -61,6 +61,7 @@ func WithInstance(instance *sql.DB, config *Config) (database.Driver, error) { } return mx, nil } + // ensureVersionTable checks if versions table exists and, if not, creates it. // Note that this function locks the database, which deviates from the usual // convention of "caller locks" in the Ql type. From 7cd138a22a63c0a124b636c657b9078e6af5ed97 Mon Sep 17 00:00:00 2001 From: Cyrille Hemidy Date: Wed, 13 Mar 2019 19:44:59 +0100 Subject: [PATCH 2/2] fix gofmt -s + fix mispelling --- database/clickhouse/clickhouse.go | 1 - database/testing/migrate_testing.go | 2 +- internal/cli/main.go | 2 +- source/godoc_vfs/vfs.go | 2 +- source/migration.go | 2 +- util.go | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/database/clickhouse/clickhouse.go b/database/clickhouse/clickhouse.go index ebf5b17d6..7362601d3 100644 --- a/database/clickhouse/clickhouse.go +++ b/database/clickhouse/clickhouse.go @@ -160,7 +160,6 @@ func (ch *ClickHouse) SetVersion(version int, dirty bool) error { return tx.Commit() } - // ensureVersionTable checks if versions table exists and, if not, creates it. // Note that this function locks the database, which deviates from the usual // convention of "caller locks" in the ClickHouse type. diff --git a/database/testing/migrate_testing.go b/database/testing/migrate_testing.go index 5b328a715..944468ef4 100644 --- a/database/testing/migrate_testing.go +++ b/database/testing/migrate_testing.go @@ -36,4 +36,4 @@ func TestMigrateUp(t *testing.T, m *migrate.Migrate) { if err := m.Up(); err != nil { t.Fatalf("%v", err) } -} \ No newline at end of file +} diff --git a/internal/cli/main.go b/internal/cli/main.go index b0c1a9aad..5b43fff72 100644 --- a/internal/cli/main.go +++ b/internal/cli/main.go @@ -53,7 +53,7 @@ Commands: goto V Migrate to version V up [N] Apply all or N up migrations down [N] Apply all or N down migrations - drop Drop everyting inside database + drop Drop everything inside database force V Set version V but don't run migration (ignores dirty state) version Print current migration version diff --git a/source/godoc_vfs/vfs.go b/source/godoc_vfs/vfs.go index c0e6b1671..03e589815 100644 --- a/source/godoc_vfs/vfs.go +++ b/source/godoc_vfs/vfs.go @@ -1,4 +1,4 @@ -// Package vfs contains a driver that reads migrations from a virtual file +// Package godoc_vfs contains a driver that reads migrations from a virtual file // system. // // Implementations of the filesystem interface that read from zip files and diff --git a/source/migration.go b/source/migration.go index fb94a331c..b8bb79020 100644 --- a/source/migration.go +++ b/source/migration.go @@ -67,7 +67,7 @@ func (i *Migrations) Append(m *Migration) (ok bool) { func (i *Migrations) buildIndex() { i.index = make(uintSlice, 0) - for version, _ := range i.migrations { + for version := range i.migrations { i.index = append(i.index, version) } sort.Sort(i.index) diff --git a/util.go b/util.go index 96b674669..b6829aafb 100644 --- a/util.go +++ b/util.go @@ -23,7 +23,7 @@ func NewMultiError(errs ...error) MultiError { return MultiError{compactErrs} } -// Error implements error. Mulitple errors are concatenated with 'and's. +// Error implements error. Multiple errors are concatenated with 'and's. func (m MultiError) Error() string { var strs = make([]string, 0) for _, e := range m.Errs {