You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (go env)?
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\markjoling\AppData\Local\go-build
set GOEXE=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=linux
set GOPATH=C:\Users\markjoling\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-fPIC -m64 -fmessage-length=0 -fdebug-prefix-map=C:\Users\MARKJO~1\AppData\Local\Temp\go-build119513918=/tmp/go-build -gno-record-gcc-switches
The arguments to a deferred function are evaluated immediately. So when you write defer erh.Check(rows.Close()), rows.Close() is evaluated immediately. This closes rows, so rows.Next doesn't return anything. Instead, do defer func() { erh.Check(rows.Close()) }().
What version of Go are you using (
go version
)?1.11.4
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\markjoling\AppData\Local\go-build
set GOEXE=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=linux
set GOPATH=C:\Users\markjoling\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-fPIC -m64 -fmessage-length=0 -fdebug-prefix-map=C:\Users\MARKJO~1\AppData\Local\Temp\go-build119513918=/tmp/go-build -gno-record-gcc-switches
What did you do?
link to bugged code and work around
https://play.golang.org/p/TO4a4QtnPSa
What did you expect to see?
i exepected rows.Next() to run.
What did you see instead?
rows.Next() did not execute
The text was updated successfully, but these errors were encountered: