driver/driver_legacy.go
func (s *stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error) {

	if s.session.IsBad() {
		return nil, driver.ErrBadConn
	}

	done := make(chan struct{})
	go func() {
		switch s.qt {
		default:
			rows, err = s.defaultQuery(ctx, args)
		case p.QtProcedureCall:
			rows, err = s.procedureCall(ctx, args)
		}
		close(done)
	}()

	select {
	case <-ctx.Done():
		return nil, ctx.Err()
	case <-done:
		return rows, err
	}
}
func (s *stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (rows driver.Rows, err error) {

	if s.session.IsBad() {
		return nil, driver.ErrBadConn
	}

	done := make(chan struct{})
	go func() {
		switch s.qt {
		default:
			rows, err = s.defaultQuery(ctx, args)
		case p.QtProcedureCall:
			rows, err = s.procedureCall(ctx, args)
		}
		close(done)
	}()

	select {
	case <-ctx.Done():
		return nil, ctx.Err()
	case <-done:
		return rows, err
	}
}
func ( s * stmt ) QueryContext ( ctx context . Context , args [ ] driver . NamedValue ) ( rows driver . Rows , err error ) { if s . session . IsBad ( ) { return nil , driver . ErrBadConn } done := make ( chan struct { } ) go func ( ) { switch s . qt { default : rows , err = s . defaultQuery ( ctx , args ) case p . QtProcedureCall : rows , err = s . procedureCall ( ctx , args ) } close ( done ) } ( ) select { case <- ctx . Done ( ) : return nil , ctx . Err ( ) case <- done : return rows , err } }
//statement
statement