1
0
mirror of https://github.com/golang/go synced 2024-09-30 20:38:32 -06:00
Commit Graph

157 Commits

Author SHA1 Message Date
Chris Broadfoot
3f8a7a0787 godoc/redirect: add redirect for design proposals at /design/.
Change-Id: Ifa10c0477a7d79673f7f841b5aebb448742cc378
Reviewed-on: https://go-review.googlesource.com/15280
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-10-01 18:35:15 +00:00
Andrew Gerrand
e1d85eb8a3 playground, godoc: remove HK and RC from share-blocked country code list
These codes were initially included because of a miscommunication.
They should not be in the list at all.

Fixes golang/go#12747

Change-Id: I1a53e9c7be8edf5e1dbb95cd03101b93023a12c1
Reviewed-on: https://go-review.googlesource.com/15082
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-28 23:55:41 +00:00
Tamir Duberstein
0f7bc42285 godoc/static: have makestatic use the same code header comment as stringer
This allows Github to hide diffs in generated files. See:
https://github.com/github/linguist/blob/473282d/lib/linguist/generated.rb#L241

Change-Id: I0565c729dacfa7861e7da7eb66bc8021d191fc3e
Reviewed-on: https://go-review.googlesource.com/15074
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-28 01:46:00 +00:00
Andrew Gerrand
e83bc56334 godoc/{dl,proxy,short}: move packages out of Google's internal repo
These were built inside Google but have been in production for years.
Move them into the public tools repository so that they can be more
easily maintained.

This is step one to moving the entire golang.org deployment process out
of Google's internal source repository.

Change-Id: I72f875c5020b3f58f1c0cea1d19268e0f991833f
Reviewed-on: https://go-review.googlesource.com/14842
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-09-23 03:53:05 +00:00
Andrew Gerrand
31971b7521 godoc: fix source links for cmd/*
Fixes golang/go#12159

Change-Id: Id498443171cbdf0fe9808745a79edc863d836db1
Reviewed-on: https://go-review.googlesource.com/14001
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-11 00:20:26 +00:00
Andrew Gerrand
1330b289ad godoc: hide and block share functionality from specific countries
This will permit us to serve *.golang.org to Chinese users.

Change-Id: I5217753aa67931522c7e6be106477534c99a20b2
Reviewed-on: https://go-review.googlesource.com/14194
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-02 05:52:45 +00:00
Alan Donovan
afcda55b39 go/ssa: rename some API features (incompatible change)
Rename the following exported names:
	(*Program).BuildAll → Build
	(*Program).Method   → MethodValue
	Package.Object      → Pkg
Also:
	(*Function).pkgobj  → pkg

Change-Id: Iff7e6c240ebe6786ba759278ac0daa3d66698013
Reviewed-on: https://go-review.googlesource.com/14134
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-08-31 22:20:12 +00:00
Nathan Youngman
6c9aff3429 website: fix JavaScript error on website and blog in non-ES6 browsers
In Safari a JavaScript error in personalizeInstallInstructions prevents
the featured articles from displaying. startsWith is an ES6-only feature.

Fixes golang/go#12283

Change-Id: I9f471362cdac0243758e482ed3a21b0d6aa48c8b
Reviewed-on: https://go-review.googlesource.com/13841
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-08-24 08:00:06 +00:00
Andrew Gerrand
b8e61d42ca cmd/godoc: remove obsolete vet redirect
The vet command has been moved back to the core repo.

Fixes golang/go#12088

Change-Id: I26e5ed6a8c7915af1cf96db4c3a16a2e812ab394
Reviewed-on: https://go-review.googlesource.com/13460
Reviewed-by: Rob Pike <r@golang.org>
2015-08-10 01:42:01 +00:00
Andrew Gerrand
7e0ad01d16 godoc/static: tweak regular expression to match source builds
(This time for sure!)

Change-Id: Ic9b7dbfb527af9aa029365f7a91bd3b949985431
Reviewed-on: https://go-review.googlesource.com/13220
Reviewed-by: Chris Broadfoot <cbro@google.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-08-05 07:07:08 +00:00
Andrew Gerrand
18635ec5c3 godoc/static: tweak regular expression to match old darwin builds
Change-Id: I74020ece0cf8b4aceb60d75475500569d08416ee
Reviewed-on: https://go-review.googlesource.com/13211
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-08-05 06:32:32 +00:00
Andrew Gerrand
a29e96e3bf godoc/static: redirect to download from installation instructions page
Change-Id: If29d04ced7404d6ba8761f734b4a16fe96959635
Reviewed-on: https://go-review.googlesource.com/13200
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-08-05 05:57:28 +00:00
Andrew Gerrand
46829bf9ce godoc/static: dynamically adjust install instructions for a given download
This change allows the download page to redirect the user to
/doc/install?download=filename so the user can see installation
instructions specific to the file they are downloading.

This is related to this change to the core repo:
https://golang.org/cl/13151

Change-Id: Ia81344ed913aea1d1a4deed021c0e07f7360ff68
Reviewed-on: https://go-review.googlesource.com/13180
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-08-05 04:18:54 +00:00
Andrew Gerrand
bbc4202318 godoc/static: shorten vertical space above headings
Without this change, a h3 below a h2 looks weird.

Change-Id: I96cd1545615547b03460cf6896acd0df1abfc1a1
Reviewed-on: https://go-review.googlesource.com/13052
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-08-03 23:58:58 +00:00
Jeff R. Allen
06e42bd9eb tools/godoc: list all sub-repos
The list of sub-repos at the bottom of the /pkg
page is unfortunately hand-maintained. With this
commit, it is now up-to-date and ready to get out
of date again.

Fixes golang/go#9081.

Change-Id: I3dc5e11ed65f53ea7299a259575ebcb6ad6b13ec
Reviewed-on: https://go-review.googlesource.com/12512
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-29 07:17:33 +00:00
Andrew Gerrand
0f0e72bcc3 godoc/static: fix handling of playground snippets with no output
Fixes golang/go#11903

Change-Id: Ia7f85d83f1f697fd787a87cd74971f6cf0540792
Reviewed-on: https://go-review.googlesource.com/12751
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-07-28 06:47:23 +00:00
Michael Stapelberg
4d49207e6b fix typo: s/connnection/connection/
Change-Id: Ib59dd669cf44b10f5ba811b4916721e6aea611d7
Reviewed-on: https://go-review.googlesource.com/12630
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-24 17:26:06 +00:00
Josh Bleecher Snyder
ec600479b2 godoc/redirect: make /issue and /issues identical
I frequently type one when the other is required.
Make them interchangeable.

Change-Id: Ib98d2b67aa42d79e6a8e9fd29fdea17048378eb6
Reviewed-on: https://go-review.googlesource.com/12509
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-22 23:30:17 +00:00
Sameer Ajmani
87156cb766 tools/godoc: remove server's dependence on "expvar".
Importing "expvar" exports server variables on /debug/vars by default.  This
raises security concerns in some environments.  Users should opt-in to this
instead.  If users need godoc metrics, we can provide a function in the godoc
package to read them.

Change-Id: Ie12e695d5958b646e82e7e00de651cc1913aa98d
Reviewed-on: https://go-review.googlesource.com/12270
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-07-16 20:19:27 +00:00
Alan Donovan
997b3545fd go/types: change {Type,Object,Selection}String to accept a Qualifier function
The optional Qualifier function determines what prefix to attach to
package-level names, enabling clients to qualify packages in different
ways, for example, using only the package name instead of its complete
path, or using the locally appropriate name for package given a set of
(possibly renaming) imports.

Prior to this change, clients wanting this behavior had to copy
hundreds of lines of complex printing logic.

Fun fact: (*types.Package).Path and (*types.Package).Name are valid
Qualifier functions.

We provide the RelativeTo helper function to create Qualifiers so that
the old behavior remains a one-liner.

Fixes golang/go#11133

Change-Id: Ibd63f639c7b3aa1738826d6165f2d810efeb8293
Reviewed-on: https://go-review.googlesource.com/11692
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-06-30 19:00:00 +00:00
Matthew Holt
9febd36660 tools/godoc: Fix indentation in doc contents
Mobile-friendly design overlooked indentation in table of contents
for article table of contents; this change restores indentation.

Change-Id: I9a3013497e1659ebfb657a8fb9374b8ad9b04b16
Reviewed-on: https://go-review.googlesource.com/11582
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-06-28 23:35:27 +00:00
Alan Donovan
a87e08b564 godoc/static/analysis: update user documentation
Change-Id: I765b246b44210612a8d7d0484beab07a86fa79c5
Reviewed-on: https://go-review.googlesource.com/9243
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-06-26 20:38:07 +00:00
Matthew Holt
f671283c22 tools/godoc: Mobile-friendly site design
This change makes golang.org responsive, including a top
bar menu and appropriate font sizing. The result is a
website that looks pleasing and is functional both on
mobile and on desktop. Also added a few print styles so
the site looks great on paper or PDF.

Change-Id: I16ee25ef4afde2002f240aec0804414bfb172a24
Reviewed-on: https://go-review.googlesource.com/9062
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-06-24 07:57:00 +00:00
Robert Griesemer
3f8eecd15b go/types: move MethodSetCache into package go/types/typeutil
Change-Id: Iba5d7c2df533948a5b28373b077cc0476a6745ad
Reviewed-on: https://go-review.googlesource.com/10770
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-06-05 17:34:01 +00:00
Gustav Paul
68353d2750 godoc/vfs: close file on error
When Stat() or IsDir() return errors, close the file to avoid a leak.

Change-Id: I46d5e34c3443413ca674f2a703d033d945c21efa
Reviewed-on: https://go-review.googlesource.com/10557
Reviewed-by: Minux Ma <minux@golang.org>
2015-06-01 03:28:17 +00:00
Shenghou Ma
cd3ef3b6f0 godoc/static: set explicit page background color
Fixes golang/go#10961.

Change-Id: I3fc947bb18535853b278bad5fa449cf259eba59c
Reviewed-on: https://go-review.googlesource.com/10451
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-05-28 01:09:23 +00:00
chai2010
fb59b33999 godoc: add missing copyright
Change-Id: Ic0256b511b4d4346702aeac18298614b1e8d5438
Reviewed-on: https://go-review.googlesource.com/9384
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-04-27 04:29:37 +00:00
Alan Donovan
9c57c19a58 go/loader: eliminate ImportFromBinary option and PackageCreated hook
The loader package now loads, parses, and type-checks a whole program
from source, and that is all.

Also:
- simplified loader logic
- ssa.Create is gone; use ssautil.CreateProgram.
- ssautil.LoadPackage renamed to BuildPackage.
  It is now independent of go/types' Import hook and the Packages map.
- ssadump: -importbin flag removed.
  The value of this flag was that it caused the tool to print IR
  for only a single package; this is now the normal behaviour.

Fixes #9955

Change-Id: I4571118258ab1a46dccece3241b7dc51401a3acc
Reviewed-on: https://go-review.googlesource.com/8953
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-04-17 18:58:17 +00:00
Sebastien Binet
473fd854f8 godoc/static: insert newlines in -src mode
Running 'godoc -src' would end up with concatenated sources:

$ godoc -src github.com/bradfitz/http2 Frame
// a frameParser parses a frame given its FrameHeader and payload
// bytes. The length of payload will always equal fh.Length (which
// might be 0).
type frameParser func(fh FrameHeader, payload []byte) (Frame, error)//
A Frame is the base interface implemented by all frame types.
// Callers will generally type-assert the specific frame type:
// *HeadersFrame, *SettingsFrame, *WindowUpdateFrame, etc.
//
// Frames are only valid until the next call to Framer.ReadFrame.
type Frame interface {

Unconditionnally insert two newlines:

$ godoc -src github.com/bradfitz/http2 Frame
// a frameParser parses a frame given its FrameHeader and payload
// bytes. The length of payload will always equal fh.Length (which
// might be 0).
type frameParser func(fh FrameHeader, payload []byte) (Frame, error)

// A Frame is the base interface implemented by all frame types.
// Callers will generally type-assert the specific frame type:
// *HeadersFrame, *SettingsFrame, *WindowUpdateFrame, etc.
//
// Frames are only valid until the next call to Framer.ReadFrame.
type Frame interface {

Fixes #9726.

Change-Id: I51ee04e53d4962c890ea601125eda8fce84d6a46
Reviewed-on: https://go-review.googlesource.com/7681
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-03-18 17:28:59 +00:00
Péter Surányi
705f1dfb24 godoc/static: fix variable reference in search.txt
Change to match searchdoc.html which works.
(Was referring to "$val.Idents" in line 26, but "$val" here is
already an element of Idents.)
Also clarify naming and comments for makestatic.

Fixes golang/go#10022.

Change-Id: Ia3f2fdadd5d10f31a1825e8db966b6e92da2b93e
Reviewed-on: https://go-review.googlesource.com/6236
Reviewed-by: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-03-02 02:09:35 +00:00
Alan Donovan
69db398fe0 go/loader: rename SourceImports flag to ImportFromBinary and invert sense
...since the zero value is more useful by far.

This is a breaking API change, obviously.  (One or two tests in this
CL have intentional been left using the zero value, i.e., they now
load source.)

Change-Id: I42287bfcdb1afef8ee84e5eac12534dd0a1fd5d2
Reviewed-on: https://go-review.googlesource.com/5653
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-02-23 23:01:10 +00:00
Alan Donovan
96af1504f6 go/ssa: add list-of-tests constant to generated testmain package
And log its value in godoc -analysis.

Related to issue 8968

Change-Id: I96a96922a3fa5c434c69e0faff1cc8ec4686b6f2
Reviewed-on: https://go-review.googlesource.com/3154
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-01-22 22:45:41 +00:00
Alan Donovan
4d45c85020 go/types: expose IsInterface predicate, eliminating 6 copies
Change-Id: I3704d7bd7a11f691c66556c1b77ef79a503d2fe9
Reviewed-on: https://go-review.googlesource.com/2173
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-01-21 18:49:27 +00:00
Shenghou Ma
4d81e11d78 godoc/redirect: update the rules for /cl/ redirect
If id is a number greater than 150k, then it is a Rietveld CL, otherwise
treat it as a Gerrit change id.

Also add support for /cl/ID/, because go commit 0edafefc36 uses this
form.

Change-Id: I46575e3284faaa727e346b34bbc46ab248cf12b3
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/1283
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-22 03:14:31 +00:00
Shenghou Ma
a47975eda8 cmd/eg, godoc/redirect: update remaining code.google.com links
Change-Id: I67da9e0c0c511c19e5b5296fbcf46f641273a7bb
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/1515
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-18 07:48:40 +00:00
Oling Cat
443d37c586 godoc/static/analysis: update a link to new home
While we're at it, fix some bad tags and wrap one long line.

Change-Id: I4808b4645b7d18c4320b0969ab53fb244d6f169d
Reviewed-on: https://go-review.googlesource.com/1520
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-18 03:22:47 +00:00
Andrew Gerrand
55402a2b46 godoc/redirect: support loading hg->git change map from a file
This isn't exposed through the godoc binary, as it will only be
used by the Google-specific deployment of godoc.

Change-Id: Id5808f3adcb7eb36a7ccd6e4960ce3f01179fe51
Reviewed-on: https://go-review.googlesource.com/1567
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-15 06:48:23 +00:00
David Symonds
24257c8cd2 tools: add import comments.
Change-Id: Idda6e64580432cb9a731e4ebf4005ee4ceb4202d
Reviewed-on: https://go-review.googlesource.com/1244
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 22:42:16 +00:00
Shenghou Ma
6e0e92af7e godoc/redirect: if id in /cl/{id} is less than 150k, treat as Gerrit CL id
Change-Id: Id69c00d908d18151486007ec03da5495b34b05f5
Reviewed-on: https://go-review.googlesource.com/1223
Reviewed-by: Andrew Gerrand <adg@golang.org>
2014-12-09 20:48:31 +00:00
Andrew Gerrand
c73666300b x/tools/godoc/redirect: point to new git/github URLs
LGTM=dsymonds
R=dsymonds
CC=golang-codereviews
https://golang.org/cl/187920043
2014-12-08 10:39:42 +11:00
Andrew Gerrand
566014162e x/tools/godoc/redirect: handle Rietveld and Gerrit CLs at /cl/
LGTM=rsc, dsymonds
R=rsc, dsymonds
CC=golang-codereviews
https://golang.org/cl/177260043
2014-11-24 13:25:05 +11:00
Andrew Gerrand
a3be5384d5 x/tools/godoc/redirect: add redirect for Gerrit reviews at /review/
LGTM=rsc, bradfitz
R=bradfitz, rsc
CC=golang-codereviews
https://golang.org/cl/178960043
2014-11-19 08:51:39 +11:00
Andrew Gerrand
5ebbcd132f go.tools: use golang.org/x/... import paths
Rewrite performed with this command:
  sed -i '' 's_code.google.com/p/go\._golang.org/x/_g' \
    $(grep -lr 'code.google.com/p/go.' *)

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/170920043
2014-11-10 08:50:40 +11:00
Andrew Gerrand
ef648ad89b go.tools/godoc/static: replace bake.sh with "go generate" rule
LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/164490043
2014-11-05 16:52:40 +11:00
Alex Brainman
30f7e63100 go.tools/godoc: do not assume that all windows paths are delimited by os.PathSeparator (fixes build)
Fixes golang/go#9003.

LGTM=adg
R=golang-codereviews, adg
CC=golang-codereviews
https://golang.org/cl/161420043
2014-10-28 12:26:29 +11:00
Alan Donovan
e2e1830b02 godoc/analysis: remove obsolete comment.
The bug it refers to is now fixed, and the alternative
implementation it suggests is not an improvement.

LGTM=gri
R=gri
CC=golang-codereviews
https://golang.org/cl/151620044
2014-10-23 13:42:24 -04:00
Andriy Lytvynov
b916c559e7 cmd/godoc: do not apply package path restrictions onto GOROOT when indexing.
Fixes golang/go#6925.

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/156540043
2014-10-23 09:34:01 -07:00
Hana Kim
13837d25ef godoc: exclude internal packages and cmd from packages page.
Internal packages are now only included with ?m=all

Fixes golang/go#8879

LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/155910044
2014-10-13 18:47:02 +02:00
Alan Donovan
15e89a9a8c godoc/analysis: log one error per error package.
Previously type errors were reported via the web interface but
not logged, but this led to confusion as to why SSA
construction and/or pointer analysis were not attempted.

LGTM=gri
R=gri, bradfitz
CC=golang-codereviews
https://golang.org/cl/136660043
2014-09-16 16:24:52 -04:00
Alan Donovan
b94e29089b godoc: run bake.sh again.
CL 141540043 was half-baked.

LGTM=bradfitz
R=bradfitz
CC=golang-codereviews
https://golang.org/cl/142130043
2014-09-15 13:13:07 -04:00