Skip to content

Commit

Permalink
Use go generate to gofmt generated files
Browse files Browse the repository at this point in the history
This is the lazy way, since getting the templates to cooperate exactly is
proving troublesome.
  • Loading branch information
flimzy committed Feb 11, 2019
1 parent 5c4d8d6 commit 3d3f1ba
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 11 deletions.
9 changes: 2 additions & 7 deletions client_gen.go
Expand Up @@ -15,9 +15,7 @@ func (c *driverClient) AllDBs(ctx context.Context, options map[string]interface{
}

func (c *driverClient) Close(ctx context.Context) error {
expected := &ExpectedClose{

}
expected := &ExpectedClose{}
if err := c.nextExpectation(expected); err != nil {
return err
}
Expand Down Expand Up @@ -67,12 +65,9 @@ func (c *driverClient) DestroyDB(ctx context.Context, arg0 string, options map[s
}

func (c *driverClient) Ping(ctx context.Context) (bool, error) {
expected := &ExpectedPing{

}
expected := &ExpectedPing{}
if err := c.nextExpectation(expected); err != nil {
return false, err
}
return expected.ret0, expected.wait(ctx)
}

2 changes: 0 additions & 2 deletions clientexpectations_gen.go
Expand Up @@ -38,7 +38,6 @@ func (e *ExpectedAllDBs) WillDelay(delay time.Duration) *ExpectedAllDBs {
// ExpectedClose represents an expectation for a call to Close().
type ExpectedClose struct {
commonExpectation

}

// WillReturnError sets the error value that will be returned by the call to Close().
Expand Down Expand Up @@ -182,4 +181,3 @@ func (e *ExpectedPing) WillDelay(delay time.Duration) *ExpectedPing {
e.delay = delay
return e
}

1 change: 0 additions & 1 deletion db_gen.go
Expand Up @@ -146,4 +146,3 @@ func (db *driverDB) ViewCleanup(ctx context.Context) error {
}
return expected.wait(ctx)
}

1 change: 0 additions & 1 deletion dbexpectations_gen.go
Expand Up @@ -324,4 +324,3 @@ func (e *ExpectedViewCleanup) WillDelay(delay time.Duration) *ExpectedViewCleanu
e.delay = delay
return e
}

1 change: 1 addition & 0 deletions kivikmock.go
@@ -1,3 +1,4 @@
package kivikmock

//go:generate go run ./gen ./gen/templates
//go:generate gofmt -s -w clientexpectations_gen.go client_gen.go dbexpectations_gen.go db_gen.go

0 comments on commit 3d3f1ba

Please sign in to comment.