Skip to content
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

database/sql: confusing documentation for Rows.Columns #27202

Closed
AlekSi opened this issue Aug 24, 2018 · 4 comments
Closed

database/sql: confusing documentation for Rows.Columns #27202

AlekSi opened this issue Aug 24, 2018 · 4 comments
Assignees

Comments

@AlekSi
Copy link
Contributor

@AlekSi AlekSi commented Aug 24, 2018

https://tip.golang.org/pkg/database/sql/#Rows.Columns says:

Columns returns the column names. Columns returns an error if the rows are closed, or if the rows are from QueryRow and there was a deferred error.

That latter part does not make sense: it is not possible to convert Row (returned by QueryRow) to Rows.

Unless I miss something, that part should be removed.

@meirf
Copy link
Contributor

@meirf meirf commented Aug 25, 2018

If this is a mistake I'm surprised it hasn't been found yet. Your "not make sense" logic seems to apply equally to the original code: https://codereview.appspot.com/5483088/diff/4001/src/pkg/exp/sql/sql.go

@AlekSi
Copy link
Contributor Author

@AlekSi AlekSi commented Sep 2, 2018

@kardianos
Copy link
Contributor

@kardianos kardianos commented Sep 3, 2018

@AlekSi I believe you are correct. Feel free to send a CL to fix, or I will later.

@kardianos kardianos self-assigned this Sep 3, 2018
AlekSi added a commit to AlekSi/go that referenced this issue Sep 3, 2018
Fixes golang#27202

Change-Id: I3e3bdb1c8d655deb6fdd374868fcac0621f8fa0c
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 3, 2018

Change https://golang.org/cl/133057 mentions this issue: database/sql: fix Rows.Columns() documentation

@gopherbot gopherbot closed this in 5ed30d8 Sep 3, 2018
@golang golang locked and limited conversation to collaborators Sep 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.