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

Comments

@pieterlouw
Copy link

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
@ianlancetaylor ianlancetaylor added this to the Go1.10 milestone Oct 16, 2017
@ianlancetaylor
Copy link
Contributor

CC @kardianos

@kardianos
Copy link
Contributor

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

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

@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
Development

No branches or pull requests

5 participants