Skip to content

Panic when no or bad file supplied #11

Open
@jake-scott

Description

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.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions