-
Notifications
You must be signed in to change notification settings - Fork 68
Fix -b, so it doesn't always error #99
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
Conversation
} | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
package main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this entire file being shown as changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"hide whitespace" on github works, it's just interesting that whatever you guys use to edit the code is changing whitespace when my vscode does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goland does run "code reformat" on save by default, which does run go fmt if the option is ticked. (which is ticked on my machine). I'm not sure if its the "code reformat" or the go fmt that is doing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how we missed the lint problems earlier, can you fix those with this?
Where are those lint failures, I can't see them in the source (and the lint output doesn't output which file the variables are in). I'm guessing they are in sqlcmd.go runQuery(). But those variables look used to me. Stranger, I'm not seeing these lint failures in PR #100 |
Fix for #98
sqlcmd wasn't excepting EOF as a valid state for input, and always returning an exit code 1 when -b is passed in.
Added failing test, that is now passing.
Console repo:
C:\src\go-sqlcmd_1>type sql.bad
select @badvar
C:\src\go-sqlcmd_1>sqlcmd.exe -i sql.bad -r0 -b 2> err.txt
C:\src\go-sqlcmd_1>echo %ERRORLEVEL%
1
C:\src\go-sqlcmd_1>type err.txt
Must declare the scalar variable "@badvar".
C:\src\go-sqlcmd_1>