Skip to content
This repository was archived by the owner on May 9, 2021. It is now read-only.

Panics when run against generated file #300

Closed
dmac opened this issue Jun 1, 2017 · 2 comments
Closed

Panics when run against generated file #300

dmac opened this issue Jun 1, 2017 · 2 comments

Comments

@dmac
Copy link

dmac commented Jun 1, 2017

Normally golint ignores generated files, but it panics when all files passed to it are generated.

Minimal repro:

$ echo '// Code generated by foo. DO NOT EDIT.
quote>
quote> package foo
quote> ' > foo.go
$ golint foo.go
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0x11d3296]

goroutine 1 [running]:
github.com/golang/lint.(*pkg).typeCheck(0xc420013860, 0xc4200c0000, 0xc4200190b0)
	/Users/dmac/go/src/github.com/golang/lint/lint.go:282 +0x366
github.com/golang/lint.(*pkg).lint(0xc420013860, 0x35, 0x235, 0x1)
	/Users/dmac/go/src/github.com/golang/lint/lint.go:152 +0x40
github.com/golang/lint.(*Linter).LintFiles(0xc420047b60, 0xc420047c00, 0xc420047bc0, 0xc420047db8, 0x235, 0x0, 0x0)
	/Users/dmac/go/src/github.com/golang/lint/lint.go:114 +0x71c
main.lintFiles(0xc420014860, 0x1, 0x1)
	/Users/dmac/go/src/github.com/golang/lint/golint/golint.go:114 +0x265
main.main()
	/Users/dmac/go/src/github.com/golang/lint/golint/golint.go:78 +0x871
@cespare
Copy link

cespare commented Jun 1, 2017

/cc @dsnet

@cespare
Copy link

cespare commented Jun 1, 2017

I think #299 is a fix for this.

@dsnet dsnet closed this as completed in c5fb716 Jun 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants