Skip to content

Commit 405ef9d

Browse files
author
Thomas Spear
committed
Run gofmt -s on the files that are failing the lint job upstream
Signed-off-by: Thomas Spear <[email protected]>
1 parent 856f9c4 commit 405ef9d

File tree

6 files changed

+34
-32
lines changed

6 files changed

+34
-32
lines changed

database/driver.go

+13-13
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ var drivers = make(map[string]Driver)
2525
// Driver is the interface every database driver must implement.
2626
//
2727
// How to implement a database driver?
28-
// 1. Implement this interface.
29-
// 2. Optionally, add a function named `WithInstance`.
30-
// This function should accept an existing DB instance and a Config{} struct
31-
// and return a driver instance.
32-
// 3. Add a test that calls database/testing.go:Test()
33-
// 4. Add own tests for Open(), WithInstance() (when provided) and Close().
34-
// All other functions are tested by tests in database/testing.
35-
// Saves you some time and makes sure all database drivers behave the same way.
36-
// 5. Call Register in init().
37-
// 6. Create a internal/cli/build_<driver-name>.go file
38-
// 7. Add driver name in 'DATABASE' variable in Makefile
28+
// 1. Implement this interface.
29+
// 2. Optionally, add a function named `WithInstance`.
30+
// This function should accept an existing DB instance and a Config{} struct
31+
// and return a driver instance.
32+
// 3. Add a test that calls database/testing.go:Test()
33+
// 4. Add own tests for Open(), WithInstance() (when provided) and Close().
34+
// All other functions are tested by tests in database/testing.
35+
// Saves you some time and makes sure all database drivers behave the same way.
36+
// 5. Call Register in init().
37+
// 6. Create a internal/cli/build_<driver-name>.go file
38+
// 7. Add driver name in 'DATABASE' variable in Makefile
3939
//
4040
// Guidelines:
41-
// * Don't try to correct user input. Don't assume things.
41+
// - Don't try to correct user input. Don't assume things.
4242
// When in doubt, return an error and explain the situation to the user.
43-
// * All configuration input must come from the URL string in func Open()
43+
// - All configuration input must come from the URL string in func Open()
4444
// or the Config{} struct in WithInstance. Don't os.Getenv().
4545
type Driver interface {
4646
// Open returns a new driver instance configured with parameters

migrate_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ import (
1717

1818
// sourceStubMigrations hold the following migrations:
1919
// u = up migration, d = down migration, n = version
20-
// | 1 | - | 3 | 4 | 5 | - | 7 |
21-
// | u d | - | u | u d | d | - | u d |
20+
//
21+
// | 1 | - | 3 | 4 | 5 | - | 7 |
22+
// | u d | - | u | u d | d | - | u d |
2223
var sourceStubMigrations *source.Migrations
2324

2425
const (

source/driver.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,21 @@ var drivers = make(map[string]Driver)
1717
// Driver is the interface every source driver must implement.
1818
//
1919
// How to implement a source driver?
20-
// 1. Implement this interface.
21-
// 2. Optionally, add a function named `WithInstance`.
22-
// This function should accept an existing source instance and a Config{} struct
23-
// and return a driver instance.
24-
// 3. Add a test that calls source/testing.go:Test()
25-
// 4. Add own tests for Open(), WithInstance() (when provided) and Close().
26-
// All other functions are tested by tests in source/testing.
27-
// Saves you some time and makes sure all source drivers behave the same way.
28-
// 5. Call Register in init().
20+
// 1. Implement this interface.
21+
// 2. Optionally, add a function named `WithInstance`.
22+
// This function should accept an existing source instance and a Config{} struct
23+
// and return a driver instance.
24+
// 3. Add a test that calls source/testing.go:Test()
25+
// 4. Add own tests for Open(), WithInstance() (when provided) and Close().
26+
// All other functions are tested by tests in source/testing.
27+
// Saves you some time and makes sure all source drivers behave the same way.
28+
// 5. Call Register in init().
2929
//
3030
// Guidelines:
31-
// * All configuration input must come from the URL string in func Open()
31+
// - All configuration input must come from the URL string in func Open()
3232
// or the Config{} struct in WithInstance. Don't os.Getenv().
33-
// * Drivers are supposed to be read only.
34-
// * Ideally don't load any contents (into memory) in Open or WithInstance.
33+
// - Drivers are supposed to be read only.
34+
// - Ideally don't load any contents (into memory) in Open or WithInstance.
3535
type Driver interface {
3636
// Open returns a new driver instance configured with parameters
3737
// coming from the URL string. Migrate will call this function

source/parse.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ var (
1616
)
1717

1818
// Regex matches the following pattern:
19-
// 123_name.up.ext
20-
// 123_name.down.ext
19+
//
20+
// 123_name.up.ext
21+
// 123_name.down.ext
2122
var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`)
2223

2324
// Parse returns Migration for matching Regex pattern.

source/testing/testing.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ import (
1515
// It assumes that the driver tests has access to the following migrations:
1616
//
1717
// u = up migration, d = down migration, n = version
18-
// | 1 | - | 3 | 4 | 5 | - | 7 |
19-
// | u d | - | u | u d | d | - | u d |
18+
//
19+
// | 1 | - | 3 | 4 | 5 | - | 7 |
20+
// | u d | - | u | u d | d | - | u d |
2021
//
2122
// See source/stub/stub_test.go or source/file/file_test.go for an example.
2223
func Test(t *testing.T, d source.Driver) {

util.go

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ type MultiError struct {
1616
// NewMultiError returns an error type holding multiple errors.
1717
//
1818
// Deprecated: Use github.com/hashicorp/go-multierror instead
19-
//
2019
func NewMultiError(errs ...error) MultiError {
2120
compactErrs := make([]error, 0)
2221
for _, e := range errs {

0 commit comments

Comments
 (0)