golang / gddo

Go Doc Dot Org
https://godoc.org
BSD 3-Clause "New" or "Revised" License
1.1k stars 266 forks source link

gddo: support repository with no top-level .go files, only sub-packages #618

Open rcoreilly opened 5 years ago

rcoreilly commented 5 years ago

What version of Go are you using (go version)?

$ go version
This is about hosted godoc.org

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

What did you do?

Tried to load my docs on godoc.org, searching github.com/emer/emergent -- (i.e., https://github.com/emer/emergent ) -- it couldn't find it.

What did you expect to see?

the docs.

What did you see instead?

nothing.

The problem appears to be that I organize my repositories without any top-level .go files, and put the eponymous package as a subdirectory, because then the view on github is cleaner (the README is right there instead of listed after all the source) and it is cleaner to navigate in my editor / file browser, and just generally seems like a better way to keep things organized.

Without finding any of these .go files, the godoc search daemon must conclude that this is not a go repository.

A good workaround is to create a top-level doc.go file, which then serves as the overview of the entire repository, as well as fixing this particular issue.

Of course, I just came up with this idea while filing this ticket, so I'll go ahead and file the ticket in case anyone else comes across the same issue, or in case the godoc tool could be made slightly more robust and look in the first-level subdirectories for .go files as well.. If that is too much of a PITA, just close the ticket.