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

268 Commits

Author SHA1 Message Date
Andrew Bonventre
951512dfed godoc: proxy /compile requests to play.golang.org
Now that play.golang.org and sandbox[-flex].golang.org have been
merged, proxy requests to the former.

Change-Id: I7d18d0494fd54c2357dc53952fa458ceb1380aca
Reviewed-on: https://go-review.googlesource.com/86253
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2018-01-04 23:58:58 +00:00
Andrew Bonventre
64890f4e2b godoc: fix missing search icon on /dl and correct borders
Some default browser stylesheets set a border radius on <button>
elements that was not being overridden in style.css. The button
should not have any border radii on the left as it should look
like an extension of the search field.

Change-Id: I458bd2e3a903a4c1dd246ff0304e7d3cf29c0988
Reviewed-on: https://go-review.googlesource.com/83296
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-11 20:09:31 +00:00
Brad Fitzpatrick
9b32ad6a00 godoc/dl: bump minimum Windows version to XP SP 3
That's what our main XP developer has, and what our builder is.

We can't vouch for anything older. Also, IIRC, there were some
TLS/cert changes in SP3 we depended on, but I can't find the details
in quick searches.

Change-Id: I876494b2c8d201e2d1a8a74ffc6150697208af6f
Reviewed-on: https://go-review.googlesource.com/83096
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2017-12-10 00:35:10 +00:00
Andrew Bonventre
a5ff95640e godoc: add andybons to binary upload whitelist
Change-Id: I87c43864b07a05d257ef94267073f0e13aff353e
Reviewed-on: https://go-review.googlesource.com/82715
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-12-07 22:40:41 +00:00
Masahiro Furudate
4de4a8d206 godoc: use "IsPredeclared" of go/doc
In the go/doc, the same map as "predeclared" is defined.
Instead of the "predeclared" map use the "IsPredeclared" function
which is an accessor for the go/doc map.

Deleted unnecessary "predeclared".

Fixes golang/go#20357

Change-Id: I4ea360efddd28a9a1236d5adfdafb1a0970a4215
Reviewed-on: https://go-review.googlesource.com/58890
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-15 18:22:28 +00:00
Andrew Bonventre
9c477bae19 godoc: use dl.google.com instead of redirector.gvt1.com
Fixes golang/go#22648

Change-Id: I59185cc1ed61235a0fcfadc060c4735372586358
Reviewed-on: https://go-review.googlesource.com/76971
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-11-10 17:53:28 +00:00
Andrew Bonventre
9b61fcc4c5 Revert "godoc: better distinguish links and link state"
This reverts commit 9bd2f44268.

Reason for revert: https://github.com/golang/go/issues/22171#issuecomment-339125376

Update golang/go#22171

Change-Id: I41da526912b3484721782e0dad02d97ab2845a12
Reviewed-on: https://go-review.googlesource.com/73151
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-24 20:47:20 +00:00
Andrew Bonventre
5ec91747d9 Revert "godoc: accessible permalinks"
This reverts commit f57adc1821.

Reason for revert: See https://github.com/golang/go/issues/22171#issuecomment-339125376 for reasoning.

Change-Id: Ifd81ad716cf2acdf7a1d73602ac781186aca5596
Reviewed-on: https://go-review.googlesource.com/73150
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-24 20:46:10 +00:00
jimmyfrasche
9bd2f44268 godoc: better distinguish links and link state
There were two issues with links in godoc:

1) They were only distinguished from ordinary text only by color,
affecting those with color-vision deficiencies.

2) The same blue used for links is used by non-links,
affecting everybody.

This change adds a an underline to all links.

Usually, it is safe to skip underlining in locations where it clear
that the only contents are navigational links, such as #pkg-index.
However, (2) prevented this.

To work around this I used some less well supported CSS techniques:
http://caniuse.com/#feat=text-decoration

Less capable browsers, which are unlikely to be used by developers, may
have a less than optimal experience, unfortunately. In more capable
browsers, including those without full support, the experience is quite
pleasant and the additional underlying does not interfere with the godoc
aesthetic.

For golang/go#22171

Change-Id: I5a0d817793e8aa31912ba065b4e5a63d4a3f138c
Reviewed-on: https://go-review.googlesource.com/69150
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-13 18:14:03 +00:00
jimmyfrasche
5d186094d5 godoc: add label and button to search bar
To increase accessibility of the search bar,
an aria-label for screen readers and a submit
button was added.

The search field was given the semantically correct
input type and marked required field as hints to UAs
that can use that to provide context to the user.

The placeholder text was restyled for improved contrast.
The javascript for handling placeholders was removed
as it is no longer necessary.

For golang/go#22171

Change-Id: I8db6428bb727a09e7f175e77100b4bcf9b6a5f3e
Reviewed-on: https://go-review.googlesource.com/69190
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-13 18:09:24 +00:00
jimmyfrasche
f57adc1821 godoc: accessible permalinks
This CL makes permalinks accessible to keyboard-users and screen
readers.

Adding an aria-label to permalinks overrides the default content
of "pilcrow".

As the permalinks only showed on hover they were inaccessible
to users who could only use a keyboard and are now always shown.

For golang/go#22171

Change-Id: I6ce3828dfedfd7edc29dd16f3eb94a0abcabfc7c
Reviewed-on: https://go-review.googlesource.com/69210
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-12 15:25:11 +00:00
Ben Haines
a567bbf739 godoc: avoid skipping heading level in package docs
The heading of the #pkg-index section of package documentation pages
uses an h2 heading but its 'Examples' and 'Package files' subsections
use h4 headings, skipping the h3 level.

This change switches the h4s to h3s and adds styling to preserve the
current font-size with the new heading level.

For golang/go#22171

Change-Id: Ifd2cacab22c1e82fd6f061b9322523fa5859a80f
Reviewed-on: https://go-review.googlesource.com/69171
Reviewed-by: jimmy frasche <soapboxcicero@gmail.com>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-10-09 17:51:41 +00:00
jimmyfrasche
0b88a3aa07 godoc: add alt attr to gopher on main package index
The gopher with a miner hat on /pkg had no alt attribute
so screen readers would announce the image by its filename.
As the image is purely decorative, adding the empty string
as alternative text prevents the image from being announced.

For golang/go#22171

Change-Id: Ib214f296d3d9f9084c44d4e33d1cbe432f2183ed
Reviewed-on: https://go-review.googlesource.com/69130
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-10-07 23:17:17 +00:00
Andrew Bonventre
bbddea47c3 godoc: fix error with gcsBaseURL not being defined
Change-Id: I508209c3bad67b791ee8c162bd4df448f9b84bef
Reviewed-on: https://go-review.googlesource.com/68270
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-10-04 20:11:18 +00:00
Andrew Bonventre
aebcdfcd02 godoc: use Google’s CDN edge cache to serve downloads
This increases reliability and performance of downloads
across locales.

Change-Id: I619f986496dea57e1ee5e8150e31b2a6f8d8dde7
Reviewed-on: https://go-review.googlesource.com/60090
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-09-14 20:43:14 +00:00
Martin Möhrmann
421c33e678 godoc: update out of sync static.go
Replace references to Share by GoogleCN.

Fixes golang/go#21725

Change-Id: I6db4aa282cca7c104cbe34b40d152aa53ce07280
Reviewed-on: https://go-review.googlesource.com/60851
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Bonventre <andybons@golang.org>
2017-09-01 14:00:58 +00:00
Andrew Bonventre
2d19ab38fa godoc: hide link to blog in header in CN
Change-Id: I952ce003edecdd62179a8dfbc3c0e56f78eecfb1
Reviewed-on: https://go-review.googlesource.com/60071
Reviewed-by: Andrew Bonventre <andybons@golang.org>
Run-TryBot: Andrew Bonventre <andybons@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-08-29 20:47:10 +00:00
Ian Lance Taylor
f03b3350b7 godoc: don't try to follow all symlinks
Revert https://golang.org/cl/45096.

Original change description:
    godoc: follow symbolic links to folders in GOROOT

    Directory walking in godoc relies on ReadDir which returns the result
    of os.Lstat.

    Instead make the the OS VFS's ReadDir use os.Stat on symlinks before
    returning.

Updates golang/go#15049
Fixes golang/go#21061

Change-Id: Ieaa7923d85842f3da5696a7f46134d16407dae66
Reviewed-on: https://go-review.googlesource.com/53634
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-07 23:14:37 +00:00
Andrew Bonventre
a237aba5f5 godoc: fix out-of-bounds panic when serving top-level files
Change-Id: I0ba84bac0c97715c0bc66fdc4c33678341ef140c
Reviewed-on: https://go-review.googlesource.com/53151
Reviewed-by: Chris Broadfoot <cbro@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-08-04 00:32:20 +00:00
Andrew Bonventre
4e70a1b26a godoc: add GoogleCN property to pages
Use that property to determine whether to show share functionality
or link to sites that are blocked in mainland China.

This change requires https://go-review.googlesource.com/c/52872

Change-Id: I47327f9dbd2624206564fa99eb1cc6a10b4f46db
Reviewed-on: https://go-review.googlesource.com/52873
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-08-02 21:09:52 +00:00
Andrew Bonventre
6fdd948b81 godoc: remove disabled admin code
Change-Id: If3e2264b874c7a5447929888fed0ce6ad61f3475
Reviewed-on: https://go-review.googlesource.com/52291
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-07-31 20:07:38 +00:00
Andrew Bonventre
5724bdc2fd x/tools/godoc: fix redirect to Gerrit
Redirects to /r/NNNN broke due to crbug.com/gerrit/6888.
Alternative URLs are available in the meantime: /NNNN and /c/NNNN.
This change uses the /NNNN format.

Fixes golang/go#21235

Change-Id: Ie30e01bedd7a8277aedd4070b5f82a754521ed03
Reviewed-on: https://go-review.googlesource.com/52150
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-07-31 16:24:22 +00:00
Michael Edwards
4ce273956a godoc: follow symbolic links to folders in GOROOT
Directory walking in godoc relies on ReadDir which returns the result
of os.Lstat.

Instead make the the OS VFS's ReadDir use os.Stat on symlinks before
returning.

Fixes golang/go#15049

Change-Id: I34d17ca0027b0245f5ef434a000e5a3fe2af11cf
Reviewed-on: https://go-review.googlesource.com/45096
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-14 21:15:33 +00:00
Brad Fitzpatrick
72ed06fbe2 godoc: include dir listing in rate limit, log dir reading errors
Updates golang/go#14252

Change-Id: I3ce2a410708900f5c80d15e722b410855fd9c571
Reviewed-on: https://go-review.googlesource.com/47651
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-07-06 20:06:05 +00:00
Brad Fitzpatrick
1b3bb8de7d godoc/dl: change OS X to macOS, clarify WinXP requirement
Change-Id: Ib90881aef9c1bec0339dbbc38cbb320d5b731d97
Reviewed-on: https://go-review.googlesource.com/47251
Reviewed-by: Andrew Bonventre <andybons@google.com>
2017-06-29 19:46:10 +00:00
Brad Fitzpatrick
9be3b7cbc7 godoc/dl: update some pretty GOARCH strings
Fixes golang/go#19082

Change-Id: Id0e985eeff543ad24ff969ff8c94e086a7bc9303
Reviewed-on: https://go-review.googlesource.com/46916
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-06-29 18:26:36 +00:00
Sina Siadat
5128de7288 godoc: add links to docs in text and dir pages
Fixes golang/go#17125

Change-Id: I22dd0561cd1c8eb30524797b6c0488d08a65285b
Reviewed-on: https://go-review.googlesource.com/29279
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-16 21:49:54 +00:00
Alan Donovan
5d733ef37e godoc: fix crash in -analysis
Fixes golang/go#20641

Change-Id: I499b4b8da2899c4b606ce3eedd30caab57607a85
Reviewed-on: https://go-review.googlesource.com/45570
Reviewed-by: Robert Griesemer <gri@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-06-13 17:41:52 +00:00
Brad Fitzpatrick
bf4b54dc68 Revert "godoc: use "IsPredeclared" of go/doc"
This reverts commit 144c6642b5.

Reason for revert: Breaks Go 1.7 and below.

See https://go-review.googlesource.com/c/43473/

Change-Id: I06ff6e9dccb842e29389af6beb67d6cdc217fb98
Reviewed-on: https://go-review.googlesource.com/43496
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
2017-05-15 17:14:06 +00:00
Masahiro Furudate
144c6642b5 godoc: use "IsPredeclared" of go/doc
In the go/doc, the same map as "predeclared" is defined.
Instead of the "predeclared" map use the "IsPredeclared" function
which is an accessor for the go/doc map.

Deleted unnecessary "predeclared".

Fixes golang/go#20357

Change-Id: I7fdf42cfeb4440fb490be9380f39035be88f9a5a
Reviewed-on: https://go-review.googlesource.com/43473
Reviewed-by: Kevin Burke <kev@inburke.com>
2017-05-13 18:26:57 +00:00
Masahiro Furudate
ce1291533b godoc: remove the function declaration link
The link of the function declaration part is unnecessary because it points to the same place.
Removed the link of the function declaration part.

"IdentMode" has been removed since it is no longer used.

Fixes golang/go#20269

Change-Id: I6399899947e46dc84c5432c1d645f6d96b7db4f6
Reviewed-on: https://go-review.googlesource.com/42892
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-05-13 14:14:02 +00:00
Kevin Burke
75e5ff36f3 godoc: make line numbers unselectable
Insert line numbers via a ::before pseudo-element so you can't select
them when you copy text. See the code comment for more information.

Fixes golang/go#20077.

Change-Id: I24a5b17786a52c8107b4f830e824526ba03bc38d
Reviewed-on: https://go-review.googlesource.com/41418
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-25 02:28:06 +00:00
Jay Conrod
3bcb6efb39 godoc: Restore anchors for variables and constants
godoc once again adds anchors for variable and constant
declarations. Individual declarations and lists of declarations are
both covered.

Fixes golang/go#19894

Change-Id: If5f8f0c3429774f33535e2e654685ba5d71937f1
Reviewed-on: https://go-review.googlesource.com/40300
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-14 23:26:29 +00:00
Kevin Burke
620ecdb8d7 all: apply new machine-generated doc spec to files
Updates golang/go#13560.

Change-Id: I1664807a065c7982a57d4dc9cee22ce261536c5b
Reviewed-on: https://go-review.googlesource.com/39202
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-04-01 01:24:29 +00:00
Kevin Burke
2946dd1f77 godoc/static: add license preamble to static file
Change-Id: Icfdb6b544ff8613efc5a183d50efe6bb92dc6784
Reviewed-on: https://go-review.googlesource.com/38165
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-16 00:32:22 +00:00
Chris Broadfoot
b282a57667 godoc/redirect: allow trailing slashes for prefix handlers
This allows URLs like golang.org/wiki/DevExp/, where before only
golang.org/wiki/DevExp was accepted.

Fixes golang/go#19432.

Change-Id: Ie41a4fe1d1930fd947c1d0523060d08c7c6d6d39
Reviewed-on: https://go-review.googlesource.com/37882
Reviewed-by: Jaana Burcu Dogan <jbd@google.com>
2017-03-15 20:02:31 +00:00
Dmitri Shuralyov
f595fb5c96 cmd/godoc, godoc: implement build.Context.IsDir, update expected error string
Prior to this change, handlerServer.GetPageInfo created a build.Context
starting with build.Default, and provided custom implementations for
its IsAbsPath, ReadDir, and OpenFile funcs. Those funcs would operate
on h.c.fs virtual filesystem.

https://godoc.org/go/build#Context.IsDir is documented as:

	// IsDir reports whether the path names a directory.
	// If IsDir is nil, Import calls os.Stat and uses the result's IsDir method.
	IsDir func(path string) bool

IsDir was left as nil, and so the default implementation was used.
The default implementation uses os.Stat and isn't aware of the h.c.fs
virtual filesystem.

This appears to have been harmless in the past, but after the change to
go/build in https://golang.org/cl/33158, it started to interfere with
the operation of godoc. The command godoc began to fail to resolve
relative import path "." in directories that exist, because the
incorrect IsDir implementation was looking in real filesystem, rather
than the virtual one:

	$ ./godoc fmt
	2017/03/04 18:59:50 cannot find package "." in:
		/target
	$ ./godoc -http=localhost:6060
	2017/03/04 19:00:07 cannot find package "." in:
		/src/fmt

Providing a custom implementation of IsDir that is aware of the h.c.fs
virtual filesystem, and performs a stat operation on the correct path
there resolves that problem. It also fixes the failing tests.

Additionally, because the exact error string returned from
Context.Import has changed after https://golang.org/cl/33158,
and now contains the text "package not found" rather than the
underlying error text from filesystem caused by a failed ReadDir
operation, the expected error message from "./godoc nonexistingpkg"
in a test needed to be updated to "cannot find package". It's no longer
dependent on the operating system.

It might be desirable to provide more relevant detail in the error
message from cmd/godoc when a package is not found, but that should be
determined and done in a followup CL. The scope of this one is to fix
normal functionality.

This change follows update to go/build in https://golang.org/cl/33158.

Helps golang/go#19401.

Change-Id: I00e2f746ec4a2fe7e640218adce75f15bdf29aaf
Reviewed-on: https://go-review.googlesource.com/37768
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-03-05 21:32:12 +00:00
David R. Jenni
ee178bea37 x/tools/godoc: remove unused functions
Found with honnef.co/go/tools/cmd/unused.

Change-Id: I193ddd265673f133a489d268629b94be693a8dbc
Reviewed-on: https://go-review.googlesource.com/37606
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-03-01 14:54:25 +00:00
David R. Jenni
718875e4f9 x/tools: simplify and format code
Semi-mechanical changes using gofmt -s
and honnef.co/go/tools/cmd/gosimple.

Change-Id: I41bcf4bea5b16c4776b7cf6534b76aa59b3c022d
Reviewed-on: https://go-review.googlesource.com/37447
Reviewed-by: Alan Donovan <adonovan@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-28 14:15:42 +00:00
Jay Conrod
e1bdc76d04 x/tools/cmd/godoc: fix broken links in composite literals
Previously, field names in composite literals were treated as normal
identifiers. For example, in Foo{X: 42}, X was treated link a normal
variable and was linked to "#X".

With this change, field links now include a prefix for their type
definition, for example, "#Foo.X".

Fixes golang/go#16031

Change-Id: I9cb501704f284fbbc05424555312307c61843e47
Reviewed-on: https://go-review.googlesource.com/36830
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-02-17 22:21:49 +00:00
Jay Conrod
00f7cd5589 x/tools/cmd/godoc: Fix incorrectly indented literals in examples
godoc formats function examples for text or HTML output by
stripping the surrounding braces and un-indenting by replacing
"\n    " with "\n". This modifies the content of string literals,
resulting in misleading examples.

This change introduces a function, replaceLeadingIndentation, which
unindents more carefully. It removes the first level of indentation
only outside of string literals. For plain text output, it adds custom
indentation at the beginning of every line including string literals.

Fixes golang/go#18446

Change-Id: I52a7f5756bdb69c8a66f031452dd35eab947ec1f
Reviewed-on: https://go-review.googlesource.com/36544
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-02-17 21:58:39 +00:00
David R. Jenni
5984771995 x/tools/godoc: gofmt -s -w
Change-Id: Ic14a0ec2782b52a0dfe7e892af9f5549f92cb2ec
Reviewed-on: https://go-review.googlesource.com/32791
Reviewed-by: Alan Donovan <adonovan@google.com>
2017-02-15 21:42:32 +00:00
Alan Donovan
6e7ee5a9ec x/tools: support Go 1.9 type aliases
For #18130.

Change-Id: Ice695602619dbbf851af970e790f07ff2ac2c141
Reviewed-on: https://go-review.googlesource.com/36623
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-02-13 21:46:59 +00:00
Ted Kornish
396c176f11 godoc: preserve ?m=... query string
Right now, clicking around packages in the godoc web interface strips
the URL of any query strings it may have, which makes traversing
internal packages a clumsy experience (constantly have to re-add ?m=...).

This revision preserves the ?m=... flag in links between packages by examining
the current PageInfoMode and converting it to a query string.

Change-Id: I4e28279d8cbf221bcc7d5bce8de04c90cc907678
Reviewed-on: https://go-review.googlesource.com/34982
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-02-08 21:12:11 +00:00
Chris Broadfoot
19c96be7c4 static: fix playground share
Change-Id: I5decba3efb750e32fbc07ac1093cd37a00b65912
Reviewed-on: https://go-review.googlesource.com/36488
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2017-02-07 22:02:51 +00:00
Alan Donovan
b56ef30191 tools: updates for minimum Go version 1.6
Details:
- remove go1.5 "default version" labels on most files
- remove go1.6 labels on a few files
- go/loader: use conf.Cwd not "." in a couple places; update faulty
  test expectations.  (Not sure why this wasn't caught sooner.)
- go/ssa/interp: add 'mono' result to time.now intrinsic
- go/gcimporter15/bimport.go: make consistent with the version in gc
- go/ssa/interp: update test error message
- go/ssa: update a comment

The go/gcimporter15/bexport.go logic is stale and needs to be brought
up to date.  Needs a separate CL since it's tricky.

Tested on go1.6, go1.7, go1.8.

Change-Id: I841189d30e131b7c49a4e8690ea7c40b55041bae
Reviewed-on: https://go-review.googlesource.com/36540
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-02-07 21:06:19 +00:00
Chris Broadfoot
69cfa78961 static: add optional save shortcut support to playground
If enabled (via the "enableShortcuts" option), Ctrl+S/Cmd+S now
saves/shares the playground snippet and initiates a download.

Credit to Alexander Kucherenko (see golang.org/cl/35950).

Updates golang/go#15378.

Change-Id: I8a2d733c25e4c95787fbe1f5ac00fa1befbb4693
Reviewed-on: https://go-review.googlesource.com/36486
Reviewed-by: Andrew Gerrand <adg@golang.org>
2017-02-07 20:35:01 +00:00
Chris Broadfoot
1a60337c22 godoc/static: clean up the expandos code that handles the hash
Change-Id: I14e6777f781253a574f76c7d8a345d248b5a4306
Reviewed-on: https://go-review.googlesource.com/36320
Reviewed-by: Russ Cox <rsc@golang.org>
2017-02-04 03:29:34 +00:00
Robert Griesemer
7e08f6711b godoc: run TestStructField for Go 1.7 and up only (fix build)
There's no testing.T.Run method in Go 1.6.

Change-Id: I0ed7bdbe91d4cc4406ad5626dbae9acc42b4853a
Reviewed-on: https://go-review.googlesource.com/36119
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-02-01 22:56:31 +00:00
Brad Fitzpatrick
61efd71121 godoc: fix quadratic and ASCII-only struct field linkification
Fixes two problems with adding the #StructType.FieldName anchors for
linkified struct fields:

* the old code was quadratic

* the old code only dealt with ASCII only

Change-Id: If03a367a94d05d3d470e1326dfb573037088ff78
Reviewed-on: https://go-review.googlesource.com/35486
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
2017-01-25 17:13:35 +00:00