-
Notifications
You must be signed in to change notification settings - Fork 265
Ability to choose GOOS and GOARCH #188
Comments
What does that mean? |
@nf My bad, I thought for a second that you needed cross compiling, but there is no need for it since godoc just checks the source and the Go source includes all platforms. Basically a generalization of this feature request would be to allow specifying buildtags. If that makes more sense, feel free to edit the issue title. |
All good. |
@nf do you mind if I try implementing this? |
What Gary said. I'd appreciate your help but let's do it right. On 21 February 2015 at 08:26, Gary Burd notifications@github.com wrote:
|
@garyburd @nf Sure no problem. We could either implement this by setting For the actual interface, I was thinking simple GET parameters: I don't intend to add UI changes. Let me know what solution you prefer. Thanks! |
I just want to point something out. godoc.org is kinda two slightly different things in one. One aspect is displaying docs for a specified Go package. Displaying different docs depending on build tags is pretty straightforward and doesn't affect anything. It's a matter of local presentation only. The other aspect is keeping track of the imports network. Which Go package imports which other Go packages. This affects the package index, and imports/importers pages. Currently, this entire imports graph assumes default linux build tags. However, if you were to use different tags, the imports may change, which would affect the graph. Also, some packages may be Windows-only or Linux-only (via tags), so godoc may not index a given Go package because mis-matched tags were considered. I don't think you'd want to deal with this aspect (because it's hard, computationally expensive). |
We really need to make Windows-only packages render nicely, and by default. I've been needing to work on https://godoc.org/golang.org/x/sys/windows lately, but linking to its documentation is pretty sad. @nf, can you see if somebody can work on this? |
/cc @alexbrainman |
Windows-only packages do work very well. But for mixed packages I never even bother to look on godoc.ord (Brad's example above is good). Maybe this does need UI change. Maybe for multi GOOS packages have a button (or some other UI tool to select one of many) to select GOOS view. But, I guess, this would have to keep selected GOOS as you follow links. Sounds complicated for me (non web developer). Akex |
env_unset.go didn't have a the windows build tag (or filename), so it was compiling for all operating systems and as a result had weird docs at https://godoc.org/golang.org/x/sys/windows showing only Unsetenv. Updates golang/gddo#188 Change-Id: I58f2c27c3d267660c97fce5a1b28da24988c62c8 Reviewed-on: https://go-review.googlesource.com/21460 Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Okay, https://godoc.org/golang.org/x/sys/windows is now a Windows-only package and it renders nicely. (As "nicely" as an auto-generated syscall package can look, at least.) |
Here is another use case where a GOARCH-aware godoc.org would be helpful: https://godoc.org/github.com/dolmen-go/endian (see #455) |
Here's another broken one: https://godoc.org/golang.zx2c4.com/wireguard/tun/wintun/setupapi only shows one file, whereas https://git.zx2c4.com/wireguard-go/tree/tun/wintun/setupapi shows quite a few. |
https://github.com/Microsoft/go-winio is pretty broken here too, unfortunately :( This issue has been kinda dead for a while but I'd be interested in helping work towards a solution for this, especially because I've been working across multiple platforms pretty regularly lately, and it would be nice to see platform caveats without diving through packages locally (even if I manually need to |
What is broken? https://godoc.org/github.com/microsoft/go-winio looks fine to me
Sorry I don't know who makes decisions here. Maybe @dmitshur will help. Alex |
The problem with this package is that zvhd.go file will build as part of "any" OS. If you make it windows only, I think, you will be able to see everything in godoc,org properly. Alex |
https://godoc.org/golang.zx2c4.com/wireguard/tun/wintun/setupapi with this one I assume the issue is mksyscall is missing the Windows-only annotation as well? |
Yes, mksyscall.go will be built for every single OS. Including Linux. I suspect godoc.org runs Linux. I suspect godoc.org application always runs help for native OS, if it is available. So, for golang.zx2c4.com/wireguard/tun/wintun/setupapi package, godoc.org will display no symbols, since Linux version contains just mksyscall.go file, and mksyscall.go has no symbols. If you use latest Go version (the one that has 41df5aeb7f02a47ff7ccf5002140b70b04a4fd46 ), you should be able to add Alex |
It would be very useful to set those envvars for the syscall package for instance. Does not need to be in the UI yet, a simple https://godoc.org/syscall?GOOS=windows would be sufficient.
I'm also not sure if Go has been cross compiled for godoc.org, but it would be great if it were.Thanks for this awesome tool that I use everyday :)
The text was updated successfully, but these errors were encountered: