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

Panic when no or bad file supplied #11

Open
jake-scott opened this issue Feb 23, 2020 · 0 comments
Open

Panic when no or bad file supplied #11

jake-scott opened this issue Feb 23, 2020 · 0 comments

Comments

@jake-scott
Copy link

The tool panics / segfaults when no "-f" option is given or if the file isn't parsable:

$ ./go-outline 
error: Could not parse file 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x574c77]

goroutine 1 [running]:
main.main()
	/home/jacob/src/go/github.com/go-outline/main.go:63 +0x2c7


$ ./go-outline  -f foo
error: Could not parse file foo
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x574d39]

goroutine 1 [running]:
main.main()
	/home/jacob/src/go/github.com/go-outline/main.go:68 +0x2d9

I am about so submit a minor PR to fix.

jake-scott added a commit to jake-scott/go-outline that referenced this issue Feb 23, 2020
Error out if "-f" option not given or if the supplied file
cannot be parsed.
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

No branches or pull requests

1 participant