Skip to content

x/tools/cmd/godoc: comment listed before signature, not after #18150

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

Closed
artyom opened this issue Dec 1, 2016 · 7 comments
Closed

x/tools/cmd/godoc: comment listed before signature, not after #18150

artyom opened this issue Dec 1, 2016 · 7 comments
Milestone

Comments

@artyom
Copy link
Member

artyom commented Dec 1, 2016

Please answer these questions before submitting your issue. Thanks!

What did you do?

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

  1. Run local godoc server: godoc -http=127.0.0.1:6060
  2. Navigate to any package documentation, i.e.: http://127.0.0.1:6060/pkg/net/http/#Server.ListenAndServe

What did you expect to see?

Function signature located between title and description/comment as here: https://golang.org/pkg/net/http/#Server.ListenAndServe

screen shot 2016-12-01 at 23 57 40

What did you see instead?

Function signature listed after description.

screen shot 2016-12-01 at 23 57 52

Does this issue reproduce with the latest release (go1.7.3)?

No

System details

go version go1.8beta1 darwin/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/tmp/go:/Users/artyom/go"
GORACE=""
GOROOT="/Users/artyom/Library/go"
GOTOOLDIR="/Users/artyom/Library/go/pkg/tool/darwin_amd64"
TERM="dumb"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/lb/3rk8rqs53czgb4v35w_342xc0000gn/T/go-build900274628=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
GOROOT/bin/go version: go version go1.8beta1 darwin/amd64
GOROOT/bin/go tool compile -V: compile version go1.8beta1 X:framepointer
uname -v: Darwin Kernel Version 16.1.0: Thu Oct 13 21:26:57 PDT 2016; root:xnu-3789.21.3~60/RELEASE_X86_64
ProductName:	Mac OS X
ProductVersion:	10.12.1
BuildVersion:	16B2555
lldb --version: lldb-360.1.65
@artyom artyom changed the title godoc http server: comment listed before signature, not after x/tools/cmd/godoc: comment listed before signature, not after Dec 1, 2016
@bradfitz bradfitz added this to the Go1.8 milestone Dec 1, 2016
@bradfitz
Copy link
Contributor

bradfitz commented Dec 1, 2016

We only meant to do that for types, not for all things.

@bradfitz
Copy link
Contributor

bradfitz commented Dec 1, 2016

@broady
Copy link
Contributor

broady commented Dec 1, 2016

Looks like it was semi-intentional:
https://go-review.googlesource.com/#/c/33279/

#16728

@bradfitz
Copy link
Contributor

bradfitz commented Dec 1, 2016

Semi. We wanted it for that case and types at least. But not funcs.

@bradfitz
Copy link
Contributor

bradfitz commented Dec 5, 2016

Chris, you got this one?

@gopherbot
Copy link
Contributor

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

@broady
Copy link
Contributor

broady commented Dec 13, 2016

I was going to do it this afternoon but @griesemer beat me to it.

@golang golang locked and limited conversation to collaborators Dec 13, 2017
@rsc rsc unassigned broady and griesemer Jun 23, 2022
henderjon pushed a commit to oggodoc/godoc that referenced this issue Jun 13, 2024
This partially reverts https://go-review.googlesource.com/#/c/33279/
(which moved doc strings above the declaration for all kinds of objects)
by moving the doc string for functions and methods below the signature
where they traditionally were.

Fixes golang/go#18150.

Change-Id: Icbb9e7edcb3b34ad1d900acb3180217abdc56a16
Reviewed-on: https://go-review.googlesource.com/34332
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants