Skip to content

Commit b793027

Browse files
committed
chore: fix typos, acronym and styles
1 parent 04b36eb commit b793027

File tree

10 files changed

+34
-34
lines changed

10 files changed

+34
-34
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Development, Testing and Contributing
22

33
1. Make sure you have a running Docker daemon
4-
(Install for [MacOS](https://docs.docker.com/docker-for-mac/))
4+
(Install for [macOS](https://docs.docker.com/docker-for-mac/))
55
1. Use a version of Go that supports [modules](https://golang.org/cmd/go/#hdr-Modules__module_versions__and_more) (e.g. Go 1.11+)
66
1. Fork this repo and `git clone` somewhere to `$GOPATH/src/github.com/golang-migrate/migrate`
7-
* Ensure that [Go modules are enabled](https://golang.org/cmd/go/#hdr-Preliminary_module_support) (e.g. your repo path or the `GO111MODULE` environment variable are set correctly)
7+
* Ensure that [Go modules are enabled](https://golang.org/cmd/go/#hdr-Preliminary_module_support) (e.g. your repository path or the `GO111MODULE` environment variable are set correctly)
88
1. Install [golangci-lint](https://github.com/golangci/golangci-lint#install)
99
1. Run the linter: `golangci-lint run`
1010
1. Confirm tests are working: `make test-short`
11-
1. Write awesome code ...
11+
1. Write awesome code
1212
1. `make test` to run all tests against all database versions
1313
1. Push code and open Pull Request
14-
14+
1515
Some more helpful commands:
1616

1717
* You can specify which database/ source tests to run:

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
and whenever we want, not just once at the beginning of all tests.
5151

5252
#### Can I maintain my driver in my own repository?
53-
Yes, technically thats possible. We want to encourage you to contribute your driver to this repository though.
53+
Yes, technically that's possible. We want to encourage you to contribute your driver to this repository though.
5454
The driver's functionality is dictated by migrate's interfaces. That means there should really
5555
just be one driver for a database/ source. We want to prevent a future where several drivers doing the exact same thing,
5656
just implemented a bit differently, co-exist somewhere on GitHub. If users have to do research first to find the

GETTING_STARTED.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Once you create your files, you should fill them.
1414
Developers and Teams should keep an eye on such cases (especially during code review).
1515
[Here](https://github.com/golang-migrate/migrate/issues/179#issuecomment-475821264) is the issue summary if you would like to read more.
1616

17-
Consider making your migrations idempotent - we can run the same sql code twice in a row with the same result. This makes our migrations more robust. On the other hand, it causes slightly less control over database schema - e.g. let's say you forgot to drop the table in down migration. You run down migration - the table is still there. When you run up migration again - `CREATE TABLE` would return an error, helping you find an issue in down migration, while `CREATE TABLE IF NOT EXISTS` would not. Use those conditions wisely.
17+
Consider making your migrations idempotent - we can run the same SQL code twice in a row with the same result. This makes our migrations more robust. On the other hand, it causes slightly less control over database schema - e.g. let's say you forgot to drop the table in down migration. You run down migration - the table is still there. When you run up migration again - `CREATE TABLE` would return an error, helping you find an issue in down migration, while `CREATE TABLE IF NOT EXISTS` would not. Use those conditions wisely.
1818

1919
In case you would like to run several commands/queries in one migration, you should wrap them in a transaction (if your database supports it).
2020
This way if one of commands fails, our database will remain unchanged.
@@ -36,7 +36,7 @@ It's also worth checking your migrations in a separate, containerized environmen
3636

3737
## Forcing your database version
3838
In case you run a migration that contained an error, migrate will not let you run other migrations on the same database. You will see an error like `Dirty database version 1. Fix and force version`, even when you fix the erred migration. This means your database was marked as 'dirty'.
39-
You need to investigate the migration error - was your migration applied partially, or was it not applied at all? Once you know, you should force your database to a version reflecting it's real state. You can do so with `force` command:
39+
You need to investigate the migration error - was your migration applied partially, or was it not applied at all? Once you know, you should force your database to a version reflecting its real state. You can do so with `force` command:
4040
```
4141
migrate -path PATH_TO_YOUR_MIGRATIONS -database YOUR_DATABASE_URL force VERSION
4242
```

MIGRATIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ the `extension` of the migration files is not checked by the library, and should
1818
be an appropriate format for the database in use (`.sql` for SQL variants, for
1919
instance).
2020

21-
Versions of migrations may be represented as any 64 bit unsigned integer.
21+
Versions of migrations may be represented as any 64-bit unsigned integer.
2222
All migrations are applied upward in order of increasing version number, and
2323
downward by decreasing version number.
2424

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Source drivers read migrations from local or remote sources. [Add a new source?]
7777
* [GitHub](source/github) - read from remote GitHub repositories
7878
* [GitHub Enterprise](source/github_ee) - read from remote GitHub Enterprise repositories
7979
* [Bitbucket](source/bitbucket) - read from remote Bitbucket repositories
80-
* [Gitlab](source/gitlab) - read from remote Gitlab repositories
80+
* [Gitlab](source/gitlab) - read from remote GitLab repositories
8181
* [AWS S3](source/aws_s3) - read from Amazon Web Services S3
8282
* [Google Cloud Storage](source/google_cloud_storage) - read from Google Cloud Platform Storage
8383

database/mongodb/mongodb.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ var DefaultMigrationsCollection = "schema_migrations"
3030
const DefaultLockingCollection = "migrate_advisory_lock" // the collection to use for advisory locking by default.
3131
const lockKeyUniqueValue = 0 // the unique value to lock on. If multiple clients try to insert the same key, it will fail (locked).
3232
const DefaultLockTimeout = 15 // the default maximum time to wait for a lock to be released.
33-
const DefaultLockTimeoutInterval = 10 // the default maximum intervals time for the locking timout.
33+
const DefaultLockTimeoutInterval = 10 // the default maximum intervals time for the locking timeout.
3434
const DefaultAdvisoryLockingFlag = true // the default value for the advisory locking feature flag. Default is true.
3535
const LockIndexName = "lock_unique_key" // the name of the index which adds unique constraint to the locking_key field.
3636
const contextWaitTimeout = 5 * time.Second // how long to wait for the request to mongo to block/wait for.
3737

3838
var (
3939
ErrNoDatabaseName = fmt.Errorf("no database name")
4040
ErrNilConfig = fmt.Errorf("no config")
41-
ErrLockTimeoutConfigConflict = fmt.Errorf("both x-advisory-lock-timeout-interval and x-advisory-lock-timout-interval were specified")
41+
ErrLockTimeoutConfigConflict = fmt.Errorf("both x-advisory-lock-timeout-interval and x-advisory-lock-timeout-interval were specified")
4242
)
4343

4444
type Mongo struct {
@@ -134,15 +134,15 @@ func (m *Mongo) Open(dsn string) (database.Driver, error) {
134134
if err != nil {
135135
return nil, err
136136
}
137-
lockingTimout, err := parseInt(unknown.Get("x-advisory-lock-timeout"), DefaultLockTimeout)
137+
lockingTimeout, err := parseInt(unknown.Get("x-advisory-lock-timeout"), DefaultLockTimeout)
138138
if err != nil {
139139
return nil, err
140140
}
141141

142142
lockTimeoutIntervalValue := unknown.Get("x-advisory-lock-timeout-interval")
143143
// The initial release had a typo for this argument but for backwards compatibility sake, we will keep supporting it
144144
// and we will error out if both values are set.
145-
lockTimeoutIntervalValueFromTypo := unknown.Get("x-advisory-lock-timout-interval")
145+
lockTimeoutIntervalValueFromTypo := unknown.Get("x-advisory-lock-timeout-interval")
146146

147147
lockTimeout := lockTimeoutIntervalValue
148148

@@ -171,7 +171,7 @@ func (m *Mongo) Open(dsn string) (database.Driver, error) {
171171
TransactionMode: transactionMode,
172172
Locking: Locking{
173173
CollectionName: lockCollection,
174-
Timeout: lockingTimout,
174+
Timeout: lockingTimeout,
175175
Enabled: advisoryLockingFlag,
176176
Interval: maxLockCheckInterval,
177177
},

database/sqlserver/sqlserver.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ func (ss *SQLServer) Close() error {
190190
return nil
191191
}
192192

193-
// Lock creates an advisory local on the database to prevent multiple migrations from running at the same time.
193+
// Lock creates an advisory lock on the database to prevent multiple migrations from running at the same time.
194194
func (ss *SQLServer) Lock() error {
195195
return database.CasRestoreOnErr(&ss.isLocked, false, true, database.ErrLocked, func() error {
196196
aid, err := database.GenerateAdvisoryLockId(ss.config.DatabaseName, ss.config.SchemaName)
@@ -214,7 +214,7 @@ func (ss *SQLServer) Lock() error {
214214
})
215215
}
216216

217-
// Unlock froms the migration lock from the database
217+
// Unlock the migration lock from the database
218218
func (ss *SQLServer) Unlock() error {
219219
return database.CasRestoreOnErr(&ss.isLocked, true, false, database.ErrNotLocked, func() error {
220220
aid, err := database.GenerateAdvisoryLockId(ss.config.DatabaseName, ss.config.SchemaName)

migrate.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ func (m *Migrate) read(from int, to int, ret chan<- interface{}) {
526526
}
527527
}
528528

529-
// readUp reads up migrations from `from` limitted by `limit`.
529+
// readUp reads up migrations from `from` limited by `limit`.
530530
// limit can be -1, implying no limit and reading until there are no more migrations.
531531
// Each migration is then written to the ret channel.
532532
// If an error occurs during reading, that error is written to the ret channel, too.
@@ -626,7 +626,7 @@ func (m *Migrate) readUp(from int, limit int, ret chan<- interface{}) {
626626
}
627627
}
628628

629-
// readDown reads down migrations from `from` limitted by `limit`.
629+
// readDown reads down migrations from `from` limited by `limit`.
630630
// limit can be -1, implying no limit and reading until there are no more migrations.
631631
// Each migration is then written to the ret channel.
632632
// If an error occurs during reading, that error is written to the ret channel, too.

source/go_bindata/examples/migrations/bindata.go

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

source/go_bindata/testdata/bindata.go

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)