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
https://go.dev/doc/database/execute-transactions
Firefox 94.0 (64-bit)
The fail function (below the marked comment), expects 2 return values. However, the function only returns fmt.Errorf(...).
fail
fmt.Errorf(...)
I copy-pasted the code to my IDE (VS Code) and got an error (the return line was marked with a red line).
return
There should be no error in the copy-pasted function. It should return, maybe, 0, fmt.Errorf(...)?
0, fmt.Errorf(...)
Error during compilation.
./main.go:229:3: not enough arguments to return have (error) want (int64, error)
I'm new to Go, so please let me know if I did something wrong instead. Thanks!
The text was updated successfully, but these errors were encountered:
wrong number of return values (want 2, got 1)
Thank you for filing this bug @imballinst and welcome to the Go project! Thank you @seankhliao for the triage. Happy New Year y'all!
@willpoint is going to send a CL shortly to fix this.
Sorry, something went wrong.
Change https://golang.org/cl/376974 mentions this issue: _content/doc: ensure database example code compiles
_content/doc: ensure database example code compiles
No branches or pull requests
What is the URL of the page with the issue?
https://go.dev/doc/database/execute-transactions
What is your user agent?
Firefox 94.0 (64-bit)
Screenshot
The
fail
function (below the marked comment), expects 2 return values. However, the function only returnsfmt.Errorf(...)
.What did you do?
I copy-pasted the code to my IDE (VS Code) and got an error (the
return
line was marked with a red line).What did you expect to see?
There should be no error in the copy-pasted function. It should return, maybe,
0, fmt.Errorf(...)
?What did you see instead?
Error during compilation.
I'm new to Go, so please let me know if I did something wrong instead. Thanks!
The text was updated successfully, but these errors were encountered: