Skip to content

Commit b2ca44a

Browse files
committed
updates travis to validate with go fmt
1 parent d1ba280 commit b2ca44a

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ go:
88
- 1.6.x
99
- 1.7.x
1010
- 1.8.x
11-
- tip
11+
# - tip # sadly fails most of thw times
1212

13-
script: go test -race -coverprofile=coverage.txt -covermode=atomic
13+
script:
14+
- go vet
15+
- test -z "$(go fmt ./...)" # fail if not formatted properly
16+
- go test -race -coverprofile=coverage.txt -covermode=atomic
1417

1518
after_success:
1619
- bash <(curl -s https://codecov.io/bash)

driver_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ func TestDuplicateNewDSN(t *testing.T) {
109109
if _, _, err := NewWithDSN("sqlmock_db_1"); err == nil {
110110
t.Error("expected error on NewWithDSN")
111111
}
112-
}
112+
}

sqlmock.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ func (c *sqlmock) prepare(query string) (*ExpectedPrepare, error) {
309309
var expected *ExpectedPrepare
310310
var fulfilled int
311311
var ok bool
312-
312+
313313
query = stripQuery(query)
314-
314+
315315
for _, next := range c.expected {
316316
next.Lock()
317317
if next.fulfilled() {
@@ -328,7 +328,7 @@ func (c *sqlmock) prepare(query string) (*ExpectedPrepare, error) {
328328
next.Unlock()
329329
return nil, fmt.Errorf("call to Prepare statement with query '%s', was not expected, next expectation is: %s", query, next)
330330
}
331-
331+
332332
if pr, ok := next.(*ExpectedPrepare); ok {
333333
if pr.sqlRegex.MatchString(query) {
334334
expected = pr

sqlmock_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ func TestPreparedQueryExecutions(t *testing.T) {
354354
}
355355
}
356356

357-
358357
func TestUnorderedPreparedQueryExecutions(t *testing.T) {
359358
t.Parallel()
360359
db, mock, err := New()
@@ -369,14 +368,14 @@ func TestUnorderedPreparedQueryExecutions(t *testing.T) {
369368
ExpectQuery().
370369
WithArgs(5).
371370
WillReturnRows(
372-
NewRows([]string{"id", "title"}).FromCSVString("5,The quick brown fox"),
373-
)
371+
NewRows([]string{"id", "title"}).FromCSVString("5,The quick brown fox"),
372+
)
374373
mock.ExpectPrepare("SELECT (.+) FROM authors WHERE id = ?").
375374
ExpectQuery().
376375
WithArgs(1).
377376
WillReturnRows(
378-
NewRows([]string{"id", "title"}).FromCSVString("1,Betty B."),
379-
)
377+
NewRows([]string{"id", "title"}).FromCSVString("1,Betty B."),
378+
)
380379

381380
var id int
382381
var name string

0 commit comments

Comments
 (0)