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

x/sys/windows: godoc is useless again #16509

Closed
bradfitz opened this issue Jul 27, 2016 · 8 comments
Closed

x/sys/windows: godoc is useless again #16509

bradfitz opened this issue Jul 27, 2016 · 8 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation FrozenDueToAge OS-Windows
Milestone

Comments

@bradfitz
Copy link
Contributor

The godoc for https://godoc.org/golang.org/x/sys/windows is empty, probably because of https://go-review.googlesource.com/24952

Maybe this is a gddo problem too. (Or maybe gddo can help or have better heuristics over which build context to use)

/cc @alexbrainman @adg @broady @shantuo @alandonovan

@alexbrainman
Copy link
Member

Unfortunately I don't have any bright ideas.

I am sure it is because of CL 24952. I can revert the change. But then we need to find different solution to issue #16368.

Alternatively we can hard code golang.org/sys/windows (and some others) in gddo to display these as windows packages. But this is very error prone. And what about other similar packages?

Maybe we could come up with some new gddo rule for that. Compare different GOOS / GOARCH versions of the package - number of global variables, functions, types and so on - and show version with most of these.

What do you think?

Alex

@broady
Copy link
Member

broady commented Jul 30, 2016

Maybe, until godoc can recognize build tags, we need a special build tag for godoc.

//+build godoc to force godoc for a file.

It's ugly, but is it bad?

@bradfitz
Copy link
Contributor Author

  1. The quickest easy fix is hard-coding specific packages (this one) to use a different build context. We could to that immediately while we do the next step:

  2. Try Linux/amd64 build context first. If it yields any exported symbols at all, stop and use it. If it's totally blank, then do a more intensive scan looking for which build context is best.

@minux
Copy link
Member

minux commented Jul 30, 2016 via email

@alexbrainman
Copy link
Member

  1. The quickest easy fix is hard-coding specific packages (this one) to use a different build context. ...

Like this https://go-review.googlesource.com/#/c/25353 ?

Alex

@gopherbot
Copy link

CL https://golang.org/cl/25353 mentions this issue.

gopherbot pushed a commit to golang/gddo that referenced this issue Sep 8, 2016
Updates golang/go#16509

Change-Id: Id0dd8f1aee82a45375363e32682e85868eea4765
Reviewed-on: https://go-review.googlesource.com/25353
Reviewed-by: Chris Broadfoot <cbro@golang.org>
@coelho
Copy link

coelho commented Nov 22, 2020

Underlying cause makes Windows development more difficult as both godoc & pkg.go.dev miss exported functions of some packages due to Windows build constraints.

Example:
https://godoc.org/github.com/microsoft/go-winio
https://pkg.go.dev/github.com/microsoft/go-winio
Missing "DialPipe" defined in "pipe.go" with the +build windows constraint (as well as many more...)

I don't think it is go doc's responsibility to enforce build constraints & if anything it should say somewhere in the documentation that a function is only exported on a certain OS/ARCH if that is the case.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 7, 2022
@prattmic
Copy link
Member

https://pkg.go.dev/golang.org/x/sys/windows works quite well now (it renders for windows by default).

https://pkg.go.dev/github.com/microsoft/go-winio renders for linux by default, but does have a drop-down for windows. A long discussion about this UX occurred on #37232.

@golang golang locked and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. Documentation FrozenDueToAge OS-Windows
Projects
None yet
Development

No branches or pull requests

7 participants