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: example usage for Out is incorrect #22292

Closed
pieterlouw opened this issue Oct 16, 2017 · 3 comments
Closed

database/sql: example usage for Out is incorrect #22292

pieterlouw opened this issue Oct 16, 2017 · 3 comments
Assignees
Milestone

Comments

@pieterlouw
Copy link

@pieterlouw pieterlouw commented Oct 16, 2017

Hi,
Small thing, but please change example usage code for sql.Out from:
_, err := db.ExecContext(ctx, "ProcName", sql.Named("Arg1", Out{Dest: &outArg}))
to:
_, err := db.ExecContext(ctx, "ProcName", sql.Named("Arg1", sql.Out{Dest: &outArg}))

Line 288 in database/sql/sql.go

What version of Go are you using (go version)?

Go 1.9

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

linux/amd64 (Windows Subsystem for Linux)

What did you do?

I copied the code in the example usage of the new Out parameter and the compiler complained about unknown type Out

What did you expect to see?

N/A

What did you see instead?

Compile error

@gbbr gbbr changed the title Example usage for sql.Out is incorrect database/sql: example usage for Out is incorrect Oct 16, 2017
@gbbr gbbr added the Documentation label Oct 16, 2017
@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Oct 16, 2017
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Oct 16, 2017

@kardianos
Copy link
Contributor

@kardianos kardianos commented Oct 16, 2017

You are correct @pieterlouw . I'll send a fix for the docs soon to add the sql. package to the Out identifier. Thanks for spotting that.

@kardianos kardianos self-assigned this Oct 16, 2017
@gopherbot
Copy link

@gopherbot gopherbot commented Oct 18, 2017

Change https://golang.org/cl/71550 mentions this issue: database/sql: fix example usage of Out

@gopherbot gopherbot closed this in a9afa4e Oct 18, 2017
@golang golang locked and limited conversation to collaborators Oct 18, 2018
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
5 participants
You can’t perform that action at this time.