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

Slice bounds out of range #5

Closed
bassu opened this issue Apr 6, 2017 · 2 comments
Closed

Slice bounds out of range #5

bassu opened this issue Apr 6, 2017 · 2 comments
Labels

Comments

@bassu
Copy link

bassu commented Apr 6, 2017

With HEAD and all previous versions, there are panics.

Here's a possible stack trace:

 ./goreporter -d . -p . -t templates/template.html
[Apollo]2017/04/07 04:48:38 There are no packages that are excepted, review all items of the package
[Apollo]2017/04/07 04:48:38 start code quality assessment...
[Apollo]2017/04/07 04:48:38 computing cyclo...
[Apollo]2017/04/07 04:48:38 running unit test...
panic: runtime error: slice bounds out of range

goroutine 1 [running]:
main.DirList.func1(0xc42025a9d0, 0x9, 0x17aee20, 0xc4202aad00, 0x0, 0x0, 0x0, 0x0)
	/Users/foo/Downloads/goreporter/utils.go:54 +0x219
path/filepath.walk(0xc42025a9d0, 0x9, 0x17aee20, 0xc4202aad00, 0xc42026f3b0, 0x0, 0x0)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:351 +0x81
path/filepath.walk(0x7fff5fbff8cd, 0x1, 0x17aee20, 0xc420286a90, 0xc42026f3b0, 0x0, 0x30)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:376 +0x414
path/filepath.Walk(0x7fff5fbff8cd, 0x1, 0xc42026f3b0, 0x0, 0xc42026f380)
	/usr/local/Cellar/go/1.8/libexec/src/path/filepath/path.go:398 +0x14c
main.DirList(0x7fff5fbff8cd, 0x1, 0x15683b2, 0x3, 0x0, 0x0, 0xc42001bf50, 0x0, 0x0)
@bassu
Copy link
Author

bassu commented Apr 7, 2017

@wgliang Looks like there is a typo at line 40 in main.go.
Perhaps you meant err != nil instead of err == nil.

$ ag -A 2 -B 2 'project path is invalid'
main.go
41-		_, err := os.Stat(*project)
42-		if err == nil {
43:			log.Fatal("project path is invalid")
44-		}
45-	}

@wgliang
Copy link
Collaborator

wgliang commented Apr 7, 2017

Sorry, this is my negligence.
When I push it finish, I regret it.

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

No branches or pull requests

2 participants