1
0
mirror of https://github.com/golang/go synced 2024-10-01 03:28:32 -06:00
Commit Graph

1617 Commits

Author SHA1 Message Date
Andrew Gerrand
6b41c776c8 cmd/godoc: always serve fmt handler, HTTPS fix redirection
Change-Id: Ib00a54f40b3c52c9bc6a07623259c5c82f9d28d9
Reviewed-on: https://go-review.googlesource.com/14933
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-25 02:10:07 +00:00
Andrew Gerrand
c206e42859 cmd/godoc: serve proxy paths without host enforcer
Change-Id: I4647c1e18df3ea441c5220cd03fe6163794b7e84
Reviewed-on: https://go-review.googlesource.com/14862
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-09-23 05:23:18 +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
40b1b219de cmd/godoc: restrict requests to HTTPS and canonical host names
Fixes golang/go#12684

Change-Id: Ibb49e604bfd92c902c9fd2bf9506ded60b2a9d8d
Reviewed-on: https://go-review.googlesource.com/14814
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-22 23:49:55 +00:00
Rob Pike
5a90b2958f vet: put a notice in main that this version of vet is not the place to update
Change-Id: I295d1e902626a3f5edd09a3b594a2059530ca821
Reviewed-on: https://go-review.googlesource.com/14820
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-21 17:48:06 +00:00
Ford Hurley
0ced849c61 tools/cmd/vet: check only first rune of example suffix
The documentation for the testing package states only that "The suffix
must start with a lower-case letter."

Fixes golang/go#12663

Change-Id: I9b079b105a7c9680325fed442c42adcf3b75055e
Reviewed-on: https://go-review.googlesource.com/14760
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-21 00:24:47 +00:00
Alan Donovan
8049553ca8 go/ssa: use sync.Once instead of sync.atomic
This adds a missing memory barrier at the end of Package.Build.

Change-Id: Ife35d5ad5a48ba121f35656fef682863d4f2aef6
Reviewed-on: https://go-review.googlesource.com/14761
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-09-18 15:11:51 +00:00
Andrew Gerrand
1d593709ec cmd/tip: serve talks.golang.org
Also make health check test the backup process.

Change-Id: I9d2ed2780c07bb08683d231fccad4674c2ac22a1
Reviewed-on: https://go-review.googlesource.com/14668
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-18 04:55:56 +00:00
Andrew Gerrand
ac6d9c1d84 cmd/present: include Google Analytics tracking code for talks.golang.org
This was formerly inserted by some deployment scripts. Putting it in
the code here simplifies deployment at little cost to other users.

Change-Id: Ic092bb560c4c90e0e5bc6f9f33426b35214d613d
Reviewed-on: https://go-review.googlesource.com/14741
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-18 04:43:10 +00:00
Andrew Gerrand
51ebb3f1be cmd/present: move critical _ import to another file
This was preventing the playground /compile and /share handlers
from being registered under Managed VMs.

Change-Id: I690bd50abc2f42b30956e734903d09487f712d4a
Reviewed-on: https://go-review.googlesource.com/14665
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-17 03:09:26 +00:00
Andrew Gerrand
ffb6076c75 playground: recognize managed vm's as being "on app engine"
Change-Id: I117b113e2782cab1180e6f56e1869525564ab18f
Reviewed-on: https://go-review.googlesource.com/14663
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-17 02:42:04 +00:00
Andrew Gerrand
25693e10e1 cmd/tip: refactor tipgodoc into general-purpose tip server
This will allow us to serve blog.golang.org and talks.golang.org from
the latest sources without re-deploying.

Change-Id: I2399a8a7eb60a0c6648916052f5f129cb826d546
Reviewed-on: https://go-review.googlesource.com/14662
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-17 02:04:37 +00:00
Andrew Gerrand
6c387a1d07 cmd/tipgodoc: implement health checking and enable auto-scaling
Change-Id: I860d0913d051616d7958a88a3c7b11a26ec1d4d6
Reviewed-on: https://go-review.googlesource.com/14661
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2015-09-17 01:18:34 +00:00
Andrew Gerrand
374b14e99b cmd/tipgodoc: fix deployment instructions
Change-Id: Iaa8e1e61f5c6966a66fc613173853846408584b5
Reviewed-on: https://go-review.googlesource.com/14636
Reviewed-by: Chris Broadfoot <cbro@google.com>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-17 00:09:34 +00:00
Matt T. Proud
c262de870b tools/cmd/vet: Sort checks list alphabetically.
The existing list of checks in doc.go has become somewhat unwieldy.
This commit is purely cosmetic and sorts the list alphabetically keyed
by the flag name.

Change-Id: Ibb56357f9d4667d199acc6637dc28f6e17903046
Reviewed-on: https://go-review.googlesource.com/14558
Reviewed-by: Rob Pike <r@golang.org>
2015-09-15 17:18:38 +00:00
Matt T. Proud
871b75fbfc tools/cmd/vet: Incorporate comments from r@.
This commit fixes a few defects from a25a8d567b:

(1.) Making the top-level vars in main consistent w.r.t. documentation
     formatting, and the-like.

(2.) Removing of one-use top-level is-test predicate.

(3.) Including documentation of what the validation does and when.

Change-Id: I19b34d25836bb2af865219d18600e1add78c3fd7
Reviewed-on: https://go-review.googlesource.com/14557
Reviewed-by: Rob Pike <r@golang.org>
2015-09-15 16:08:13 +00:00
Matt T. Proud
a25a8d567b tools/cmd/vet: Create vet checks for examples.
In spite of https://blog.golang.org/examples and
http://golang.org/pkg/testing/#pkg-examples, a number of internal Go
authors have found writing documentation examples to be problematic in
the sense that the syntax is error-prone due to loose coupling with
identifiers found in the source corpus.

This commit introduces a suite of validations for documentation
examples:

    Overall:
    - Correct suffices, if present
    - Niladic function argument and return signatures

    func Example() {}
    func ExampleF() {}
    - F exists
    func ExampleT() {}
    - T exists
    func ExampleT_M() {}
    - T exists
    - M exists within T

Further, if the example is in `package foo_test`, vet attempts to
resolve the respective lookups in `package foo`, if `package foo`
exists (cf., `package stringutil_test`).

Change-Id: Ifa13906363541ebf28325681b749b14b7f8b103d
Reviewed-on: https://go-review.googlesource.com/11982
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-09-15 07:54:34 +00:00
Andrew Gerrand
d868c356db imports: update static stdlib index to go1.5
Fixes golang/go#12609

Change-Id: Ic7efa796d50037a3b0fbf87a748c07bd41f07e02
Reviewed-on: https://go-review.googlesource.com/14576
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-09-15 05:17:18 +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
Andrew Gerrand
4df6ae9fad playground: block share functionality from specific countries
This will permit us to serve *.golang.org to Chinese users.

Change-Id: If184760d7f4c9e49a3df3785c15af770958413de
Reviewed-on: https://go-review.googlesource.com/14190
Reviewed-by: Jason Buberel <jbuberel@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-02 05:51:01 +00:00
Alan Donovan
b9fbbb8e31 refactor/eg: refactor to break dependency on go/loader
Change-Id: I0a865a694b911437944743f60bfaa2a937d85c9a
Reviewed-on: https://go-review.googlesource.com/14133
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-09-01 14:26:06 +00:00
Alan Donovan
af0fde4393 cmd/fiximports: -replace flag specifies canonical packages in absence of import comments
+ Tests.

Change-Id: I0544546dda93d24aedbbfe1ffdc6882e76bfb3f8
Reviewed-on: https://go-review.googlesource.com/12940
Reviewed-by: Jason Buberel <jbuberel@google.com>
2015-09-01 14:23:39 +00:00
Andrew Gerrand
513c731aab cmd/godoc: add x/arch repo to list
Fixes golang/go#12393

Change-Id: I0b56c36dec11a6c2fddcc092867f24701815dce3
Reviewed-on: https://go-review.googlesource.com/14145
Reviewed-by: Dave Cheney <dave@cheney.net>
2015-09-01 03:09:27 +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
Alan Donovan
e21b7325f7 refactor/lexical: delete package
It is possible to reconstruct the lexical environment at any point
using only Object and Scope positions; see CL 9544 for an example.

Change-Id: I1268f9490c072ceb1c4d044df2e9c49678d73dfd
Reviewed-on: https://go-review.googlesource.com/14131
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-08-31 21:14:04 +00:00
Alan Donovan
25bacdead0 refactor/rename: fix build breakage (due to go/types version skew)
Change-Id: Id798ff0acdc9d4a83efe1b760ca32ede6a1aa5bb
Reviewed-on: https://go-review.googlesource.com/14132
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-08-31 21:13:35 +00:00
Alan Donovan
03e05ec5a5 refactor/rename: eliminate dependency on refactor/lexical package
so that we can delete that package.

lexicalLookup reconstructs the lexical scope from the existing tree of
types.Scope blocks, using source position information to determine
which prefix of declarations are visible.  (Inspired by Russ's
lookupAtPos in github.com/rsc/grind/grinder.)

forEachLexicalRef implements the part of the recursion from
refactor/lexical that enumerates the ast.Idents that use lexical
lookup.  (I would still like to eliminate this redundant logic by
having go/types record environments, as in CL 9493.)

Change-Id: I040ab33b508aad2dc68fd48850fe92ec072045d1
Reviewed-on: https://go-review.googlesource.com/9544
Reviewed-by: Sameer Ajmani <sameer@golang.org>
2015-08-31 20:58:11 +00:00
Alan Donovan
b9f1f6a3c1 go/loader: in stdlib_test, skip packages that depend on vendoring
until vendoring support is added (soon).

Change-Id: I954514b5c6b82622c0c831a289ccdcc16dbd37f8
Reviewed-on: https://go-review.googlesource.com/14130
Reviewed-by: Alan Donovan <adonovan@google.com>
2015-08-31 20:55:27 +00:00
Robert Griesemer
b48dc8da98 cmd/gotype: keep gotype working with Go1.4
Fixes #12305.

Change-Id: Ib9e36621708ab35fd0e685aaca37d8640f265366
Reviewed-on: https://go-review.googlesource.com/13899
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-25 03:53:50 +00:00
Robert Griesemer
12c48ced94 cmd/gotype: use std lib go/types instead of x/tools version
Change-Id: I89ba20512129d0557f3f606d8242472d78ea37a9
Reviewed-on: https://go-review.googlesource.com/13898
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-24 21:28:19 +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
Russ Cox
93604a3dc2 go/loader: fix fd leak and limit calls to ioutil.ReadDir
This makes 'ulimit -n 128; go test -short -v' pass.
It did not before, and that was breaking the openbsd/386 builder.

For golang/go#11811.

Change-Id: Idfdb2f4007ed06c6084486c0e58a561add552d2c
Reviewed-on: https://go-review.googlesource.com/13695
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-08-18 23:39:26 +00:00
Andrew Gerrand
9f2124fb70 cmd/tipgodoc: change capitalization of 'Authors' to be consistent
Change-Id: I040007a2b9bfa3388f3fbed839b2e5c6853925b3
Reviewed-on: https://go-review.googlesource.com/13596
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-08-16 08:15:44 +00:00
David R. Jenni
4f50f44d7a imports: fix bug, where unused named import is mistaken for unnamed import.
Fixes #8149.

Change-Id: Ia3d318f70981b2032a71d3fd32eaffba20cfbcbd
Reviewed-on: https://go-review.googlesource.com/13371
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
2015-08-12 17:18:37 +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
Robert Griesemer
d02228d185 cmd/callgraph: exclude test for Android
For golang/go#11811.

Change-Id: I4cec398a0a6d43f3297c205f73193522928a5b31
Reviewed-on: https://go-review.googlesource.com/13280
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-06 01:46:44 +00:00
Robert Griesemer
958ab4f550 x/tools: disable tests not supported on Android
For golang/go#11811.

Change-Id: Icf16a2d47fcf2fe0d79dd825ccb851a3d63a660f
Reviewed-on: https://go-review.googlesource.com/13268
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
2015-08-06 00:36:03 +00:00
Robert Griesemer
63f996ec75 cmd/stringer: exclude end-to-end test for Android
Change-Id: I37224abb3d9ca902ed23d520493f3b2794ef0471
Reviewed-on: https://go-review.googlesource.com/13261
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
2015-08-05 22:44:14 +00:00
Robert Griesemer
874e71548b go/ssa/interp: exclude another long-running test if -short is set
For #11811.

Change-Id: Ic3bf3c035ce402f144b5b6670d5ef062874b167e
Reviewed-on: https://go-review.googlesource.com/13260
Reviewed-by: Chris Manghane <cmang@golang.org>
2015-08-05 21:28:02 +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
Robert Griesemer
5a6a7b4d40 x/tools/cmd/stress: don't build for Plan 9 (syscall.SIGABRT not defined)
See golang/go#11975.
For golang/go#11811.

Change-Id: I56ee20cd798bf963afdf3c81c4745f07850f6dcc
Reviewed-on: https://go-review.googlesource.com/13034
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-31 22:56:17 +00:00
Robert Griesemer
32dcbb4ccc cmd/godoc: exclude TestTypeAnalysis on Plan 9 for now
Attempt to make build work on Plan 9.

For golang/go#11811.

Change-Id: I37a5eaef441262342994a8f77c86aa5e120deea7
Reviewed-on: https://go-review.googlesource.com/13033
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-31 22:39:36 +00:00
Robert Griesemer
50fdc6b946 go/loader: exclude example tests from Windows tests
The output of ExampleConfig_CreateFromFiles and ExampleConfig_Import
are different for Windows that for other platforms: They contain
internal/syscall/windows packages and unicode/utf16 not present in
the output for other platforms.

For golang/go#11811.

Change-Id: Id391fbeec8123616da86cb68fc3cefcd513b2493
Reviewed-on: https://go-review.googlesource.com/13032
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-31 22:13:26 +00:00
Robert Griesemer
784fe34e06 go/ssa/interp: abort long-running test when testing.Short() is set
This should help on slower machines.

For golang/go#11811.

Change-Id: Ibb5d5bf0f6cedcda6437ef0ee3fc1f4ba89dab90
Reviewed-on: https://go-review.googlesource.com/13009
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2015-07-31 22:12:02 +00:00
Alex Brainman
d89a972634 go/loader: remove blank line
Blank line was inserted by mistake in CL 12830.

Change-Id: I9e4b3562a4efcab43c5a85c2960a0d22c0aab752
Reviewed-on: https://go-review.googlesource.com/12883
Reviewed-by: Dmitri Shuralyov <shurcool@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
2015-07-31 21:22:20 +00:00