Skip to content

Commit

Permalink
Make NewLoader accept a pointer (#167)
Browse files Browse the repository at this point in the history
* Make NewLoader accept a pointer

* Fix test
  • Loading branch information
cristinaleonr authored Mar 28, 2023
1 parent e27f60e commit 8b6a257
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cloudtest/bqfake/bqfake.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ func (q Query) Read(context.Context) (bqiface.RowIterator, error) {
// Loader implements parts of bqiface.Loader to allow for testing.
type Loader struct {
bqiface.Loader
job Job
job *Job
err error
}

// NewLoader returns a new instance of Loader.
func NewLoader(job Job, err error) *Loader {
func NewLoader(job *Job, err error) *Loader {
return &Loader{
job: job,
err: err,
Expand Down
4 changes: 2 additions & 2 deletions cloudtest/bqfake/bqfake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ func TestTableUpdate(t *testing.T) {
}

func TestTableLoaderFrom(t *testing.T) {
ldr := bqfake.NewLoader(bqfake.Job{}, nil)
ldr := bqfake.NewLoader(&bqfake.Job{}, nil)
tbl := bqfake.NewTable(bqfake.TableOpts{
Loader: ldr,
})
Expand Down Expand Up @@ -386,7 +386,7 @@ func TestNewQueryReadClient(t *testing.T) {
}

func TestLoaderRun(t *testing.T) {
job := bqfake.Job{}
job := &bqfake.Job{}
err := errors.New("loader error")
ldr := bqfake.NewLoader(job, err)
got, gotErr := ldr.Run(context.Background())
Expand Down

0 comments on commit 8b6a257

Please sign in to comment.