diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 66b3d9b..b75efa1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,12 +4,6 @@ updates: directory: / schedule: interval: monthly - ignore: - # Test-only drivers. Every newer version raises the go directive above 1.10, - # which the fork keeps; revisit when they move to a nested test module. - - dependency-name: github.com/go-sql-driver/mysql - - dependency-name: github.com/lib/pq - - dependency-name: github.com/mattn/go-sqlite3 - package-ecosystem: github-actions directory: / schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd71b8b..1e8ae79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,6 @@ jobs: fail-fast: false matrix: go: - - "1.23.x" - "1.24.x" - "1.25.x" - oldstable diff --git a/go.mod b/go.mod index dad89f5..5f98319 100644 --- a/go.mod +++ b/go.mod @@ -1,10 +1,11 @@ module github.com/secondwindoss/sqlx -go 1.10 +go 1.24.0 require ( - filippo.io/edwards25519 v1.1.1 // indirect - github.com/go-sql-driver/mysql v1.8.1 - github.com/lib/pq v1.10.9 - github.com/mattn/go-sqlite3 v1.14.22 + github.com/go-sql-driver/mysql v1.10.1 + github.com/lib/pq v1.12.3 + github.com/mattn/go-sqlite3 v1.14.52 ) + +require filippo.io/edwards25519 v1.2.0 // indirect diff --git a/go.sum b/go.sum index c3dfb1b..3fad883 100644 --- a/go.sum +++ b/go.sum @@ -1,9 +1,8 @@ -filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -filippo.io/edwards25519 v1.1.1 h1:YpjwWWlNmGIDyXOn8zLzqiD+9TyIlPhGFG96P39uBpw= -filippo.io/edwards25519 v1.1.1/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= -github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y= -github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg= -github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= -github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +filippo.io/edwards25519 v1.2.0 h1:crnVqOiS4jqYleHd9vaKZ+HKtHfllngJIiOpNpoJsjo= +filippo.io/edwards25519 v1.2.0/go.mod h1:xzAOLCNug/yB62zG1bQ8uziwrIqIuxhctzJT18Q77mc= +github.com/go-sql-driver/mysql v1.10.1 h1:arlSnNLq6a5yxGxV7qg9lF4j0C+KwD6NbQyKr9QL6ME= +github.com/go-sql-driver/mysql v1.10.1/go.mod h1:M+cqaI7+xxXGG9swrdeUIoPG3Y3KCkF0pZej+SK+nWk= +github.com/lib/pq v1.12.3 h1:tTWxr2YLKwIvK90ZXEw8GP7UFHtcbTtty8zsI+YjrfQ= +github.com/lib/pq v1.12.3/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA= +github.com/mattn/go-sqlite3 v1.14.52 h1:wVbm2Qnf4OXkqhBTSPuCRZDRnxfbVrrmiCEroVdog8U= +github.com/mattn/go-sqlite3 v1.14.52/go.mod h1:6JTjA44L93a0QCyJef5YvlPoKXntQPjzWv5gtm9sB6w= diff --git a/sqlx.go b/sqlx.go index b627d38..7435e48 100644 --- a/sqlx.go +++ b/sqlx.go @@ -5,7 +5,7 @@ import ( "database/sql/driver" "errors" "fmt" - "io/ioutil" + "os" "path/filepath" "reflect" "strings" @@ -54,7 +54,7 @@ func mapper() *reflectx.Mapper { // - it implements sql.Scanner // - it has no exported fields func isScannable(t reflect.Type) bool { - if reflect.PtrTo(t).Implements(_scannerInterface) { + if reflect.PointerTo(t).Implements(_scannerInterface) { return true } if t.Kind() != reflect.Struct { @@ -709,7 +709,7 @@ func LoadFile(e Execer, path string) (*sql.Result, error) { if err != nil { return nil, err } - contents, err := ioutil.ReadFile(realpath) + contents, err := os.ReadFile(realpath) if err != nil { return nil, err } @@ -870,7 +870,7 @@ type rowsi interface { // struct is expected but something else is given func structOnlyError(t reflect.Type) error { isStruct := t.Kind() == reflect.Struct - isScanner := reflect.PtrTo(t).Implements(_scannerInterface) + isScanner := reflect.PointerTo(t).Implements(_scannerInterface) if !isStruct { return fmt.Errorf("expected %s but got %s", reflect.Struct, t.Kind()) } diff --git a/sqlx_context.go b/sqlx_context.go index 32621d5..dc90bc6 100644 --- a/sqlx_context.go +++ b/sqlx_context.go @@ -7,7 +7,7 @@ import ( "context" "database/sql" "fmt" - "io/ioutil" + "os" "path/filepath" "reflect" ) @@ -100,7 +100,7 @@ func LoadFileContext(ctx context.Context, e ExecerContext, path string) (*sql.Re if err != nil { return nil, err } - contents, err := ioutil.ReadFile(realpath) + contents, err := os.ReadFile(realpath) if err != nil { return nil, err } diff --git a/types/types.go b/types/types.go index fe4c634..ea37482 100644 --- a/types/types.go +++ b/types/types.go @@ -6,7 +6,7 @@ import ( "database/sql/driver" "encoding/json" "errors" - "io/ioutil" + "io" ) // GzippedText is a []byte which transparently gzips data being submitted to @@ -43,7 +43,7 @@ func (g *GzippedText) Scan(src interface{}) error { return err } defer reader.Close() - b, err := ioutil.ReadAll(reader) + b, err := io.ReadAll(reader) if err != nil { return err }