Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

all: run modernize happy #1741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zchee wants to merge 1 commit into go-sql-driver:master
base: master
Choose a base branch
Loading
from zchee:modernize-2025年11月06日
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ Kamil Dziedzic <kamil at klecza.pl>
Kei Kamikawa <x00.x7f.x86 at gmail.com>
Kevin Malachowski <kevin at chowski.com>
Kieron Woodhouse <kieron.woodhouse at infosum.com>
Koichi Shiraishi <zchee.io at gmail.com>
Lance Tian <lance6716 at gmail.com>
Lennart Rudolph <lrudolph at hmc.edu>
Leonardo YongUk Kim <dalinaum at gmail.com>
Expand Down
10 changes: 5 additions & 5 deletions benchmark_test.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func benchmarkQuery(b *testing.B, compr bool) {
defer wg.Wait()
b.StartTimer()

for i := 0; i < concurrencyLevel; i++ {
for range concurrencyLevel {
go func() {
for {
if atomic.AddInt64(&remain, -1) < 0 {
Expand Down Expand Up @@ -129,7 +129,7 @@ func BenchmarkExec(b *testing.B) {
b.ReportAllocs()
b.ResetTimer()

for i := 0; i < concurrencyLevel; i++ {
for range concurrencyLevel {
go func() {
for {
if atomic.AddInt64(&remain, -1) < 0 {
Expand Down Expand Up @@ -345,7 +345,7 @@ func BenchmarkQueryRawBytes(b *testing.B) {
for i := range blob {
blob[i] = 42
}
for i := 0; i < 100; i++ {
for i := range 100 {
_, err := db.Exec("INSERT INTO bench_rawbytes VALUES (?, ?)", i, blob)
if err != nil {
b.Fatal(err)
Expand Down Expand Up @@ -404,7 +404,7 @@ func benchmark10kRows(b *testing.B, compress bool) {
args[i] = sval
}
for i := 0; i < 10000; i += 100 {
for j := 0; j < 100; j++ {
for j := range 100 {
args[j*2] = i + j
}
_, err := stmt.Exec(args...)
Expand Down Expand Up @@ -462,7 +462,7 @@ func BenchmarkReceiveMetadata(b *testing.B) {

// Create a table with 1000 integer fields
createTableQuery := "CREATE TABLE large_integer_table ("
for i := 0; i < 1000; i++ {
for i := range 1000 {
createTableQuery += fmt.Sprintf("col_%d INT", i)
if i < 999 {
createTableQuery += ", "
Expand Down
8 changes: 2 additions & 6 deletions driver_test.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ func runTests(t *testing.T, dsn string, tests ...func(dbt *DBTest)) {
cleanupSql := "DROP TABLE IF EXISTS test"

for _, test := range tests {
test := test
t.Run("default", func(t *testing.T) {
dbt := &DBTest{t, db}
t.Cleanup(func() {
Expand Down Expand Up @@ -220,8 +219,6 @@ func runTestsParallel(t *testing.T, dsn string, tests ...func(dbt *DBTest, table

t.Parallel()
for _, test := range tests {
test := test

t.Run("default", func(t *testing.T) {
t.Parallel()

Expand Down Expand Up @@ -491,7 +488,6 @@ func TestMultiQuery(t *testing.T) {
dbt.Error("no data")
}
rows.Close()

})
}

Expand Down Expand Up @@ -3071,7 +3067,7 @@ func TestRowsColumnTypes(t *testing.T) {
bx0 := []byte("\x00")
bx42 := []byte("\x42")

var columns = []struct {
columns := []struct {
name string
fieldType string // type used when creating table schema
databaseTypeName string // actual type used by MySQL
Expand Down Expand Up @@ -3284,7 +3280,7 @@ func TestRawBytesAreNotModified(t *testing.T) {
const blobSize = defaultBufSize * 3 / 4 // Second row overwrites first row.
const insertRows = 4

var sqlBlobs = [2]string{
sqlBlobs := [2]string{
strings.Repeat(blob, blobSize/len(blob)),
strings.Repeat(strings.ToUpper(blob), blobSize/len(blob)),
}
Expand Down
2 changes: 1 addition & 1 deletion packets.go
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -907,7 +907,7 @@ func (rows *textRows) readRow(dest []driver.Value) error {
}

func (mc *mysqlConn) skipPackets(n int) error {
for i := 0; i < n; i++ {
for range n {
if _, err := mc.readPacket(); err != nil {
return err
}
Expand Down

AltStyle によって変換されたページ (->オリジナル) /