sdboyer / gps

your dependencies have arrived
MIT License
270 stars 24 forks source link

At least one github account doesn't match allowed pattern #194

Closed undeconstructed closed 7 years ago

undeconstructed commented 7 years ago

Hi, I've run into a github repo that doesn't match the naming rules in deduce.go: https://github.com/sean-/seed. I tried reverting to this line: https://github.com/sdboyer/gps/blob/master/deduce.go#L53, but that now produces a panic down the line - removing the requirement that user name ends with [A-Za-z0-9] fixes this example, although I don't know if that's a good enough fix for everyone. Thanks.

sdboyer commented 7 years ago

Ah, good catch, thank you!

I suspect the panic was probably because the newer regex includes more capture groups that are being referenced later on. Could you provide the text of the panic, for my reference?

undeconstructed commented 7 years ago

Line number is actually 461, I added the line that prints "src: \<nil>"

$ dep init
src: <nil>
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x4df824]

goroutine 67 [running]:
panic(0x7ad300, 0xc420010100)
    /usr/lib/go-1.7/src/runtime/panic.go:500 +0x1a1
github.com/golang/dep/vendor/github.com/sdboyer/gps.(*SourceMgr).SyncSourceFor(0xc420082840, 0xc420223590, 0x22, 0x0, 0x0, 0x0, 0x0)
    /home/phil/go/src/github.com/golang/dep/vendor/github.com/sdboyer/gps/source_manager.go:462 +0x204
main.getProjectData.func1(0xc420223590, 0x22, 0xc420082840)
    /home/phil/go/src/github.com/golang/dep/cmd/dep/init.go:243 +0x6c
created by main.getProjectData
    /home/phil/go/src/github.com/golang/dep/cmd/dep/init.go:268 +0xb4d
sdboyer commented 7 years ago

Oh - well, #187 (which isn't yet merged into dep downstream) should have caused this to not panic, but it wouldn't have actually fixed the error. Still, that at least helps us know that the panic isn't in the deducer itself - it's at least returning out an error.

jstemmer commented 7 years ago

This was fixed in #201, so this issue can be closed.

sdboyer commented 7 years ago

ah thanks, i'm used to auto-closing