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: wrong redirect if my package name the same as standard library's #15060

Open
darasion opened this Issue Apr 1, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@darasion

darasion commented Apr 1, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
    go version go1.6 windows/amd64
  2. What operating system and processor architecture are you using (go env)?
    set GOARCH=amd64
    set GOBIN=
    set GOEXE=.exe
    set GOHOSTARCH=amd64
    set GOHOSTOS=windows
    set GOOS=windows
    set GOPATH=D:\workspace\Golang
    set GORACE=
    set GOROOT=D:\Go
    set GOTOOLDIR=D:\Go\pkg\tool\windows_amd64
    set GO15VENDOREXPERIMENT=1
    set CC=gcc
    set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
    set CXX=g++
    set CGO_ENABLED=1
  3. What did you do?
    • set GOPATH to D:\workspace\Golang
    • write some code with package name "rpc" in dir D:\workspace\Golang\src\rpc
    • run: godoc -http=:6060 .
    • visit http://localhost:6060/pkg/rpc/ on browser
  4. What did you expect to see?
    the html document of my code with package name rpc .
    http://localhost:6060/pkg/rpc/
  5. What did you see instead?
    the document of standard library code with package name net/rpc .
    http://localhost:6060/pkg/net/rpc/
@minux

This comment has been minimized.

Member

minux commented Apr 1, 2016

@bradfitz

This comment has been minimized.

Member

bradfitz commented Apr 1, 2016

Please don't. I don't want to break links. Also, I sometimes navigate to https://golang.org/pkg/http on purpose because I know it'll work.

@bradfitz

This comment has been minimized.

Member

bradfitz commented Apr 1, 2016

@darasion, usually people put their code under $GOPATH/src/github.com/USERNAME/rpc instead of $GOPATH/src/something

@adg

This comment has been minimized.

Contributor

adg commented Apr 4, 2016

One could argue that we should only serve the redirects from golang.org, rather than baking them into every version of godoc. But ultimately, @darasion should be putting packages in a namespace that they control.

@darasion

This comment has been minimized.

darasion commented Apr 7, 2016

Thanks everybody, now I understand why.

@bradfitz bradfitz added this to the Unreleased milestone Apr 7, 2016

@agnivade

This comment has been minimized.

Member

agnivade commented Apr 25, 2018

ping @bradfitz - NeedsFix or close ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment