diff --git a/README.md b/README.md index 0752f0e..2926276 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,10 @@ Scan standard lib database rows directly to structs or slices. For the most comprehensive and up-to-date docs see the [godoc](https://godoc.org/github.com/blockloop/scan) +```go +import "github.com/blockloop/scan/v2" +``` + ## Examples ### Multiple Rows diff --git a/bench_scanner_test.go b/bench_scanner_test.go index df00590..a58d041 100644 --- a/bench_scanner_test.go +++ b/bench_scanner_test.go @@ -3,7 +3,7 @@ package scan_test import ( "testing" - "github.com/blockloop/scan" + "github.com/blockloop/scan/v2" "github.com/stretchr/testify/assert" ) diff --git a/example_scanner_test.go b/example_scanner_test.go index 2a23b8b..4970b0d 100644 --- a/example_scanner_test.go +++ b/example_scanner_test.go @@ -7,7 +7,7 @@ import ( "math/rand" "os" - "github.com/blockloop/scan" + "github.com/blockloop/scan/v2" _ "github.com/proullon/ramsql/driver" ) diff --git a/examples_values_columns_test.go b/examples_values_columns_test.go index 6595799..282107d 100644 --- a/examples_values_columns_test.go +++ b/examples_values_columns_test.go @@ -3,7 +3,7 @@ package scan_test import ( "fmt" - "github.com/blockloop/scan" + "github.com/blockloop/scan/v2" ) func ExampleValues() { diff --git a/fakes_test.go b/fakes_test.go index bbd1e13..80f2fbc 100644 --- a/fakes_test.go +++ b/fakes_test.go @@ -6,7 +6,7 @@ import ( sync "sync" "testing" - scan "github.com/blockloop/scan" + scan "github.com/blockloop/scan/v2" ) func fakeRowsWithColumns(t testing.TB, rowCnt int, cols ...string) *FakeRowsScanner { diff --git a/go.mod b/go.mod index d30ac2e..cbc9ad5 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/blockloop/scan +module github.com/blockloop/scan/v2 go 1.17 diff --git a/scanner_test.go b/scanner_test.go index fa3a130..4b21a70 100644 --- a/scanner_test.go +++ b/scanner_test.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "testing" - "github.com/blockloop/scan" + "github.com/blockloop/scan/v2" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) @@ -311,6 +311,7 @@ func TestRowStrictScansNestedFields(t *testing.T) { assert.Equal(t, "Brett", res.Item.First) assert.Equal(t, "Jones", res.Item.Last) } + func TestRowsStrictIgnoresFieldsWithoutDBTag(t *testing.T) { rows := fakeRowsWithRecords(t, []string{"First", "Last"}, []interface{}{"Brett", "Jones"},