-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/tools/cmd/godoc: Doc links not working #53927
Comments
The Enhanced documentation is part of go1.19+, the binaries will need to be built with that. Even then, godoc won't work as it uses a different url structure. godoc is frozen / deprecated as of #49212 |
Please forgive me if chiming in with a godoc pkgsite replacement script. Based on the idea of Milan Daverde(?) I'm using this script that automatically installs the components if not done so for the user and then runs pkgsite in "local" filesystem mode; this works around the problem that pkgsite isn't designed to hot reload changed files from the local file system: #!/bin/bash
set -e
if ! command -v pkgsite &>/dev/null; then
export PATH="$(go env GOPATH)/bin:$PATH"
if ! command -v pkgsite &>/dev/null; then
go install golang.org/x/pkgsite/cmd/pkgsite@master
fi
fi
# In case the user hasn't set an explicit installation location, avoid polluting
# our own project...
NPMBIN=$(cd $HOME && npm bin)
export PATH="$NPMBIN:$PATH"
if ! command -v browser-sync &>/dev/null; then
(cd $HOME && npm install browser-sync)
fi
if ! command -v nodemon &>/dev/null; then
(cd $HOME && npm install nodemon)
fi
# https://stackoverflow.com/a/2173421
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
# https://mdaverde.com/posts/golang-local-docs
browser-sync start --port 6060 --proxy localhost:6061 --reload-delay 2000 --reload-debounce 5000 --no-ui --no-open &
PKGSITE=$(which pkgsite)
nodemon --signal SIGTERM --watch './**/*' -e go --exec "browser-sync --port 6060 reload && $PKGSITE -http=localhost:6061 ." Maybe the Go team might want to document how to get pkgsite working in a local godoc-replacement scenario? |
As I mentioned on the last line, this is also not behaving correctly with pkgsite. |
sure, include more reproduction instructions though, since it's working locally for me. |
Ok Thanks |
The problem is that
|
If you imported the package you would be able to reference it with the imported package name. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, installed with
go install golang.org/x/tools/cmd/godoc@latest
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
godoc -links=true
What did you expect to see?
The docs with links to
Iterator.Next
and toio.EOF
What did you see instead?
Neither link is being interpreted by godoc. The same issue happens with
pkgsite
, should I open a separate bug for that?The text was updated successfully, but these errors were encountered: