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

Return false for empty string #4

Merged
merged 2 commits into from
Feb 12, 2019
Merged

Conversation

mattn
Copy link
Contributor

@mattn mattn commented Feb 12, 2019

If there are environment variables which have empty value, csvq panic.

csvq interactive shell
Press Ctrl+D or execute "EXIT;" to terminate this shell.

[snip]
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/mithrandie/csvq/lib/cmd.MustBeEnclosed(0xc0001200e0, 0x0, 0xc000086ff0)
	c:/dev/godev/src/github.com/mithrandie/csvq/lib/cmd/utils.go:204 +0x256
github.com/mithrandie/csvq/lib/cmd.EnvironmentVariableSymbol(0xc0001200e0, 0x0, 0x7c4a96, 0x1)
	c:/dev/godev/src/github.com/mithrandie/csvq/lib/cmd/utils.go:191 +0x43
github.com/mithrandie/csvq/lib/query.(*Completer).updateEnvironmentVariables(0xc0000fc000)
	c:/dev/godev/src/github.com/mithrandie/csvq/lib/query/completer_readline.go:268 +0x1bb
github.com/mithrandie/csvq/lib/query.(*Completer).Update(0xc0000fc000)
	c:/dev/godev/src/github.com/mithrandie/csvq/lib/query/completer_readline.go:183 +0x7d
github.com/mithrandie/csvq/lib/query.ReadLineTerminal.UpdateCompleter(...)
	c:/dev/godev/src/github.com/mithrandie/csvq/lib/query/terminal_readline.go:122
github.com/mithrandie/csvq/lib/action.LaunchInteractiveShell(0xc00008fad0, 0x0, 0x0)
	c:/dev/godev/src/github.com/mithrandie/csvq/lib/action/run.go:106 +0x1bd
main.main.func9(0xc0000b6160, 0x0, 0x0)
	c:/dev/godev/src/github.com/mithrandie/csvq/main.go:258 +0x98
github.com/urfave/cli.HandleAction(0x755060, 0xc0000566f0, 0xc0000b6160, 0xc0000b2600, 0x0)
	c:/dev/godev/src/github.com/urfave/cli/app.go:501 +0xcf
github.com/urfave/cli.(*App).Run(0xc0000ce000, 0xc000056170, 0x1, 0x1, 0x0, 0x0)
	c:/dev/godev/src/github.com/urfave/cli/app.go:268 +0x59d
main.main()
	c:/dev/godev/src/github.com/mithrandie/csvq/main.go:276 +0x149a

@codecov
Copy link

codecov bot commented Feb 12, 2019

Codecov Report

Merging #4 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
+ Coverage   92.46%   92.46%   +<.01%     
==========================================
  Files          70       70              
  Lines       13408    13410       +2     
==========================================
+ Hits        12398    12400       +2     
  Misses        852      852              
  Partials      158      158
Impacted Files Coverage Δ
lib/cmd/utils.go 97.12% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 945ae48...f63fdc0. Read the comment docs.

@mithrandie mithrandie changed the base branch from master to develop February 12, 2019 17:35
@mithrandie mithrandie merged commit 49d49ea into mithrandie:develop Feb 12, 2019
@mattn mattn deleted the fix-empty-env branch February 12, 2019 17:36
mithrandie added a commit that referenced this pull request Feb 12, 2019
- Fix the following bug.
  - Panic occurs when an empty environment variable is passed. (Github Pull Request #4)
@mithrandie
Copy link
Owner

This request is merged and released as version 1.8.2. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants