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

545 Commits

Author SHA1 Message Date
Audrey Lim
b41cbfc0fa x/tools/present: add presenter notes documentation
Fixes golang/go#14654

Fixes golang/go#12355

Change-Id: I0c05db624170f7bef5883192b47b618ca343a830
Reviewed-on: https://go-review.googlesource.com/21489
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-01 21:14:44 +00:00
Audrey Lim
19c2ab042a x/tools/present: display presenter notes and synchronize browser windows
Change-Id: If7d5cc52f7594c141060d40e8393ac69cb7ba9ad
Reviewed-on: https://go-review.googlesource.com/21488
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-06-01 05:16:27 +00:00
Yasuhiro Matsumoto
ba484b064f cmd/bundle: move down imports of external package
imports should be ordered like

    import (
    	"fmt"

    	"golang.org/x/text"
    )

Change-Id: I000374833de370463d772c2596c7ac6ee5e9725c
Reviewed-on: https://go-review.googlesource.com/23026
Reviewed-by: Mikio Hara <mikioh.mikioh@gmail.com>
Reviewed-by: Nigel Tao <nigeltao@golang.org>
2016-05-26 02:53:53 +00:00
Francesc Campoy
0b2f4dcf4d tools: fix 'Split called after Scan'
Change-Id: I2dae23440d33fa830107575987805e858e4bf4a7
Reviewed-on: https://go-review.googlesource.com/22749
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-05-04 16:29:22 +00:00
Andrew Gerrand
c9a2436076 cmd/godoc: set Strict-Transport-Security header in production
This coerces browsers into enforcing HTTPS-only for golang.org.

Change-Id: I91a4cc64b10b9836ef5623314a3cf22a54033dc2
Reviewed-on: https://go-review.googlesource.com/22673
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-02 17:22:30 +00:00
Andrew Gerrand
0238d429c7 cmd/tip: set Strict-Transport-Security header in production
Change-Id: I33db74025785c802a634f324ad110a4ec5381c1f
Reviewed-on: https://go-review.googlesource.com/22674
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-05-02 17:21:26 +00:00
Alan Donovan
14480f21a0 cmd/guru: for determinism, sort referrers output in test
Previously we were sorting only JSON objects, but we must do the same
for plain output too to avoid sporadic failures.

Tested 20 times.

Change-Id: Ic60363b720c2afc91b57864bc93e298f83e85b99
Reviewed-on: https://go-review.googlesource.com/22555
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-04-28 19:07:35 +00:00
Alan Donovan
50ff896a1c cmd/guru: definition: opt: avoid type checker for qualified identifiers
For a 'definition' query on X in p.X, use special logic to load and
parse package p and find the declaration of package member X, without
using the type checker.  Such queries now typically take under
10ms (faster than godef).

The logic assumes that import "something/p" defines the name p.  If this
assumption is false, p.X could be a selection of a field or method X on
a member p of the same package, defined in another file.
So don't write code like that.

Added missing test of 'definitions'.
JSON tests now sanitize absolute $GOPATH filenames in the output.

Fixes issue #15458

Change-Id: I21e75fcc9372aaedd56851cace444aef205c7a97
Reviewed-on: https://go-review.googlesource.com/22526
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-04-28 17:00:30 +00:00
Alan Donovan
0f5f9fcf9a cmd/guru: implements: if selected expr is a value, use its type
...as the basis of the query, instead of reporting an error.

+ test

Change-Id: Ie5defa98cd8dfc8e200e296c2aa02c88893cf9ac
Reviewed-on: https://go-review.googlesource.com/22117
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-04-28 14:33:14 +00:00
Alan Donovan
9ae7e1769c cmd/guru: Emacs: run guru asynchronously using compilation-mode
We define a derived mode of compilation-mode, so that various
names say "guru" instead of "compilation", and use the hooks it
provides to apply our postprocessing incrementally instead of
all at the end.  It's much faster, and works nicely with the
new streaming referrers query.

Compilation mode requires a shell command, not an execve array,
so go-guru--compile-command joins the arguments with spaces.
go-guru--exec has been specialized for JSON mode,
and renamed to go-guru--json.

go-guru--set-scope-if-empty is now done by each mode, to avoid
the NEED-SCOPE parameter to go-guru--exec.

Change-Id: I692b8b28449b7cc17fd6251a152588f9d8b89ebc
Reviewed-on: https://go-review.googlesource.com/21772
Reviewed-by: Dominik Honnef <dominik@honnef.co>
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-04-28 14:21:22 +00:00
Andrew Gerrand
94f857c7cf cmd/tip: bump verison serving tip.golang.org to HEAD
This picks up a recent change to the playground package.

Change-Id: I9b5f0ef9981373274d707014a2c0e2786e9624c0
Reviewed-on: https://go-review.googlesource.com/22538
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-28 01:23:19 +00:00
Andrew Gerrand
53006ac4c2 cmd/tip: redirect from HTTP to HTTPS; update to Go 1.6
Change-Id: I7b219a991df4f71d068b62a22f69acb123ac31f0
Reviewed-on: https://go-review.googlesource.com/22367
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-27 01:13:02 +00:00
Alan Donovan
5e468032ea cmd/guru: avoid bug when -scope=""
strings.Split is not your friend.

Change-Id: I829f08f113f3340b2dd865aea47f5759a427f7c4
Reviewed-on: https://go-review.googlesource.com/22116
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-04-18 16:46:08 +00:00
Dominik Honnef
3114265539 cmd/guru: emacs: interpret byte offsets correctly
Change-Id: Id506c6c0b3f3c585781bfc38df1b665d507a7c33
Reviewed-on: https://go-review.googlesource.com/22019
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-04-17 18:15:17 +00:00
Dominik Honnef
837ce23ea3 cmd/guru: emacs: report most specific element in expand-region
Keep the leftmost element when removing duplicates, so that we report
"function call" instead of "expression statement".

Also split go-guru--enclosing into two functions.

Change-Id: Ie325613e292e36dda9558eda54bc7323fbf0bc6d
Reviewed-on: https://go-review.googlesource.com/22132
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-04-17 13:26:57 +00:00
Hironao OTSUBO
321c6fd171 cmd/stringer: fixed usage line typo
Change-Id: I5852d03c0326d82c13d9e1078f9648ecc695fbbf
Reviewed-on: https://go-review.googlesource.com/22150
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-17 02:19:27 +00:00
Andrew Gerrand
c3291436fa cmd/tip: look for godoc binary under $GOPATH/bin instead of $GOROOT/bin
A recent change to the cmd/go tool made it place godoc in $GOPATH/bin
instead of the special-cased $GOROOT/bin.

Change-Id: If026ff7e3a521ee2aa9b4107585124df108d7124
Reviewed-on: https://go-review.googlesource.com/21951
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-13 03:37:58 +00:00
Dominik Honnef
446a18e709 go/buildutil, cmd/guru: extract overlay context into buildutil
This extracts the overlay context and archive parsing from guru into
buildutil.

At least one tool (gogetdoc) has a vendored copy of this code already,
and more tools implementing the same functionality will follow.

The new code in buildutil is an almost identical copy of the code in
guru (names aside), except for the following changes:

- Instead of reading into a bytes.Buffer, we read directly into a []byte
  of appropriate size

- sameFile first attempts a simple comparison of path.Clean'ed paths.

Change-Id: I97cd978ccc10722e3648e5e10625fa7f1407f202
Reviewed-on: https://go-review.googlesource.com/21805
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-04-13 01:11:48 +00:00
Dominik Honnef
fb9c7fc43c cmd/guru: emacs: add function for expandiong region
The go-guru-expand-region function uses the "what" query to determine
the enclosing regions. Consecutive calls to go-guru-expand-region will
reuse a cached version of the list.

Change-Id: Ice9ac5540c1b639c6cbdc505866bbab347be1e98
Reviewed-on: https://go-review.googlesource.com/21754
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-04-13 01:08:39 +00:00
Alan Donovan
2da0720e4f cmd/guru: support streaming plain and -json output
Visible changes:
- "referrers" queries now emit a stream of results,
  so they start appearing quickly even in large queries.
  We no longer report the total number of matches.
- packageReferrers now also uses AfterTypeCheck hook and streaming.
- XML support has been dropped.
- The -format flag has been replaced by -json.

JSON protocol changes:
- The enclosing Result struct has been removed.
- Likewise the 'mode' field (since the caller knows it already)
- "freevars" and "referrers" now emit a stream of objects
  In the case of referrers, the first object has a different from the rest.
- The "referrers" results include the text of the matching line
  (parity with -json=false)

Implementation details:
- the concurrency-safe q.Output function can be called
  many times, each with a queryResult to print.
- fset is no longer saved in Query (cleaner)
- queryResult methods renamed PrintPlain, JSON

Change-Id: I41a4e3f57f266fcf043ece4045bca82c6f6a356f
Reviewed-on: https://go-review.googlesource.com/21397
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-04-11 19:51:55 +00:00
Audrey Lim
b75b3f5cd5 x/tools/present: add command line flag to enable presenter notes
Change-Id: I9d4414ce8bafcb13f53361b45774f379bacd886b
Reviewed-on: https://go-review.googlesource.com/21486
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-04-07 00:38:29 +00:00
Robert Griesemer
adaaa07486 x/tools: delete x/tools/go/types and dependent packages/client files
Per https://groups.google.com/forum/#!topic/golang-announce/qu_rAphYdxY
this change deletes the packages

  go/exact
  go/gccgoimporter
  go/gcimporter
  go/importer
  go/types
  cmd/vet

from the x/tools repo and any files depending on those packages
building against Go 1.4.

x/tools packages depending on any of these libraries must use the
respective versions from the std lib or use vendored versions if
building against 1.4.

Remaining packages may or may not build against Go 1.4 anymore
and will not be supported against 1.4.

Change-Id: I1c655fc30aee49b6c7326ebd4eb1bb0836ac97e0
Reviewed-on: https://go-review.googlesource.com/20810
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-04-06 21:52:49 +00:00
Andrew Gerrand
e77df0732c cmd/tip: use manual scaling for tip.golang.org
Always serve from four instances to avoid flakiness.

Change-Id: I11684f93bb27a377f54ddbe4fb3d95894d393a48
Reviewed-on: https://go-review.googlesource.com/21528
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2016-04-06 00:03:48 +00:00
Andrew Gerrand
f2e4f834ec cmd/present/static: remove unused function
Change-Id: I2d5db20ffb2ae59818b69d33d91256bc829ee6d8
Reviewed-on: https://go-review.googlesource.com/21445
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-04-04 05:09:31 +00:00
Dominik Honnef
74b98c2c7a cmd/guru: emacs: only check modified buffers with file names
We cannot determine the extension of buffers with no file names (not
without throwing an error, anyway.)

Change-Id: I2b10390da738d71b6f95a6f668d3b92b54db29ed
Reviewed-on: https://go-review.googlesource.com/20470
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-28 14:50:23 +00:00
Dominik Honnef
fc3ceb1825 cmd/guru: emacs: update default-directory
That way, running guru on /a/foo.go, followed by /b/bar.go won't leave
the user with a display buffer that still defaults to /a/

Change-Id: I3f9b085c6d206ac2adc269fc2009799c624c371a
Reviewed-on: https://go-review.googlesource.com/20475
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-28 14:50:15 +00:00
Dominik Honnef
999f507100 cmd/guru: emacs: store output in separate buffer
Now that we have both interactive and non-interactive uses of the guru,
we should separate the command output buffer from the display buffer.

Change-Id: I50082fdc3847c7b12869e204509141e906df3852
Reviewed-on: https://go-review.googlesource.com/20473
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-28 14:50:08 +00:00
Dominik Honnef
5c5d833208 cmd/guru: emacs: support running on nameless buffers
By using guru's -modified flag and making up a file name, we can run
guru on a buffer that has no file attached to it. This feature will only
be useful for queries that operate on single files, as otherwise our made
up name could cause conflicts.

This will be useful for the "what" query and features using it.

Change-Id: I3d199bc0548245d59ba7b492f57beb9422d7f43d
Reviewed-on: https://go-review.googlesource.com/20431
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-28 14:50:02 +00:00
Alan Donovan
35cacb533e cmd/guru: change "Method set:" to less formal "Methods:"
Change-Id: I7a43f3e9ed7e88f4f8f09d4d112c81aa037b7d8d
Reviewed-on: https://go-review.googlesource.com/21111
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-03-28 14:29:15 +00:00
Dominik Honnef
361bcb2be3 all: address vet issues, fix print calls
This fixes some print calls with wrong format directives. Additionally,
struct initialisers were changed to use keyed fields, purely to reduce
the amount of noise generated by go vet.

Change-Id: Ib9f6fd8f2dff7ce84826478de0ba83dda9746270
Reviewed-on: https://go-review.googlesource.com/21180
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2016-03-27 20:36:34 +00:00
Dominik Honnef
47218d24f2 cmd/guru: whicherrs: don't crash on dead code
Change-Id: I5e80613ec27a4edb45516ff1ff3a88d5f9cb3a67
Reviewed-on: https://go-review.googlesource.com/21130
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-25 16:35:34 +00:00
Dominik Honnef
824b504fc7 cmd/guru: emacs: highlight all instances of an identifier
Implement the "what" query and use it to get all uses of an
identifier (the "sameids" attribute). The user can either manually call
go-guru-hl-identifier, which will highlight all instances of the
identifier under point, or they can enable the
go-guru-hl-identifier-mode minor mode. The minor mode sets up an idle
timer, which will highlight the current identifier after a configurable
timeout. If the user modifies the buffer, or moves point off of an
identifier, we clear the highlight.

Change-Id: Iac870f3bcd17e0002eafcba0b73f07adaa03cd76
Reviewed-on: https://go-review.googlesource.com/20433
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-25 02:11:11 +00:00
David R. Jenni
21cc49bd03 cmd/guru: fix assignment to entry in nil map.
Fixes golang/go#14746.

Change-Id: Id79c43c7d3700b98c010aa7dc0aac2463164be09
Reviewed-on: https://go-review.googlesource.com/20988
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-21 19:52:00 +00:00
Andrew Gerrand
d8da78068e cmd/tip: add context to error values and log prints
To help track down some flakiness.

Change-Id: I2dd21abdc0f05c58857da580d962b0ab72cf52b3
Reviewed-on: https://go-review.googlesource.com/20728
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-16 04:48:27 +00:00
Robert Griesemer
1431634c56 cmd/guru: fix for prior submission (fix build)
Accidentally submitted wrong file version in
https://go-review.googlesource.com/20719.

TBR: adonovan

Change-Id: I362ded51cf9cef8cb22faf6a2334ce01678d9f4e
Reviewed-on: https://go-review.googlesource.com/20742
Reviewed-by: Robert Griesemer <gri@golang.org>
2016-03-15 22:17:46 +00:00
Robert Griesemer
ce9c53141f cmd/guru: adjust test output for go1.5 (fix build)
In go1.5, go/constant (floating-point) numeric values are printed
as fractions. Correct output as necessary so that they always
appear as floating-point numbers to match golden files.

Change-Id: If63a14d8d87bb664bf6272b16345e38e8d638ead
Reviewed-on: https://go-review.googlesource.com/20719
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-15 21:51:11 +00:00
Dominik Honnef
c5b51756ce cmd/guru: emacs: add go-guru-debug variable
Don't print debug messages unless go-guru-debug is set.

Change-Id: I1332a0b10eba1d1107ef987734b2b787ae28d9c2
Reviewed-on: https://go-review.googlesource.com/20432
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-09 20:00:51 +00:00
Dominik Honnef
b023cf6107 cmd/guru: emacs: update scope documentation
Also fix a typo in the tool's help string.

Change-Id: I54a9ed4a5515b137b0fbf1b2391dd6fa84b2d2d8
Reviewed-on: https://go-review.googlesource.com/20474
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-09 15:55:45 +00:00
Andrew Gerrand
498e5ca207 cmd/tip: kill godoc when it fails to be ready on time
If godoc didn't come up quickly enough, we would leave it running and
then try to start another one on the same port.
The new one would fail to start, being unable to bind to the address,
causing cascading failures.

Also increase the timeout to 10 minutes.

Change-Id: I7008a39f649021ea213902d557f26bf78567026d
Reviewed-on: https://go-review.googlesource.com/20420
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2016-03-08 22:55:24 +00:00
Alan Donovan
3d26f6847a go/ssa: make *BuilderMode satisfy flag.Value
The BuilderModeFlag function does not work with flag packages (such as
Google's) that define their own FlagSet.  This change exposes a type
that satisifies flag.Value insted of a function.  That type
is *BuilderMode; there's no need for a separate wrapper type.

Change-Id: I8095b80de499e3c52a29a5c1996d1b1fe3799358
Reviewed-on: https://go-review.googlesource.com/20330
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-03-07 22:18:09 +00:00
Konstantin Shaposhnikov
53f5cdeed1 cmd/present: fix displaying line numbers for .code and .play
Line numbers match line numbers from the included file,
not the lines in the segment selected by the
.code or .play START/STOP regexps.

Fixes golang/go#5248

Change-Id: I374e7b665e98db5032446ae49e6fae00d9d2b975
Reviewed-on: https://go-review.googlesource.com/20311
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-03-07 22:14:29 +00:00
Konstantin Shaposhnikov
1074774aec cmd/present: fix slides movement when -play=false
Fix by removing jQuery usage from slides.js as jquery.js is only
available when play.js is included.

Fixes golang/go#9878

Change-Id: I5793350105b138d7b7645f11d814e1d2f573a73e
Reviewed-on: https://go-review.googlesource.com/20288
Reviewed-by: Andrew Gerrand <adg@golang.org>
2016-03-07 22:13:35 +00:00
Konstantin Shaposhnikov
7a73fe1b6c cmd/guru: emacs: add default key binding for whicherrs
Bind go-guru-whicherrs to `C-C C-o e'

Also remove go-guru-callgraph as callgraph mode is not supported
by guru.

Change-Id: Id233d178629a3cafc00e4f9640191c3d3c673cf1
Reviewed-on: https://go-review.googlesource.com/20310
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-07 15:54:09 +00:00
Alan Donovan
d2abdd5413 cmd/guru: fix nil deref when position is not in Go source
+ test

Fixes issue golang/go#14684

Change-Id: I56023bf36c307d02c71b4ddf08aee9c229fc66c1
Reviewed-on: https://go-review.googlesource.com/20247
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-07 15:53:42 +00:00
Dominik Honnef
adda3a6894 cmd/guru: emacs: push mark in go-guru-definition
This allows users to swap point and mark to jump between use and
definition in the same buffer, or pop-tag-mark (M-*) to jump back to the
use even between multiple buffers.

This mirrors the behaviour of godef-jump from go-mode.

Also remove an obosolete TODO and fix a typo.

Change-Id: I614090493b565acadf359ebb4c7092f4c673fd56
Reviewed-on: https://go-review.googlesource.com/20303
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-07 15:33:11 +00:00
Dominik Honnef
459f0c0f73 cmd/guru: emacs: allow passing tags to guru
Change-Id: I2e49d050add1f764a0e41300b2cca8da699f418a
Reviewed-on: https://go-review.googlesource.com/20302
Reviewed-by: Alan Donovan <adonovan@google.com>
2016-03-07 02:38:31 +00:00
Alan Donovan
2336c53cf0 cmd/guru: compute referrers as packages are type checked
This CL makes little observable difference to the behavior but paves the
way for streaming 'referrers' and (later) 'implements' queries which
scan the entire workspace, but print each result as soon as it is found.

The go/loader package now exposes a hook, AfterTypeCheck, that lets
clients inspect each package as soon as it is type-checked, and also
modify it, for instance to release unneeded data structures.

A 'referrers' query applied to an exported object must scan the entire
workspace.  It uses this hook so to gather uses of the query object in
streaming fashion.  However, for now, it still accumulates the results
and prints them all at the end, though I propose to change that in a
follow-up.

Code details:
- The referrers logic had a 2-iteration loop to load first the query
  package and then if necessary the enlarged program.  The second
  iteration has now been unrolled and split into globalReferrers.
- Queries for package names (whether in a package declaration or
  a qualified identifier) have been split off into packageReferrers.
  It now loads all direct importers of the query package,
  which catches some references that were missing before.
  (It used to inspect only the forward dependencies of the query
  package.)

Also:
- Referrers.Pos (the position of query identifier) was removed from the
  JSON output.  It's a nuisance to compute now, and it's already
  absent from the plain output.
  (In a follow-up, I plan to simplify the information content of the
  JSON output exactly what is currently printed in the plain output.)

Change-Id: Ia5677636dc7b0fe4461a5d393107665757fb9a97
Reviewed-on: https://go-review.googlesource.com/19794
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-04 21:13:08 +00:00
Alan Donovan
3dafbd1ba4 go/types/typeutil: make IntuitiveMethodSet(*C) nonempty for concrete types C
This fixes a bug in guru describe.

Also, add a test of IntuitiveMethodSet.

Change-Id: Ied3780807afd88e664fdb186619499670529fe33
Reviewed-on: https://go-review.googlesource.com/20166
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-03 19:43:35 +00:00
Alan Donovan
6c84e9e3e0 cmd/guru: make fastQueryPos indirect through the -modified map
This fixes a bug in which guru reports a "query position beyond end of
file" error when making a query from an unsaved editor buffer at an
offset greater than the length of the file on disk.

Change-Id: I908c024d8dd14baa657b4227e3231fa760443732
Reviewed-on: https://go-review.googlesource.com/20167
Reviewed-by: Daniel Morsing <daniel.morsing@gmail.com>
2016-03-03 19:00:43 +00:00
Alan Donovan
6f233b96df cmd/guru: fix nil dereference in describe
+ test

Fixes issue golang/go#14579

Change-Id: I6fd56f10c170027f06917935ccbc28490d413d8a
Reviewed-on: https://go-review.googlesource.com/20100
Reviewed-by: Michael Matloob <matloob@golang.org>
2016-03-01 22:59:02 +00:00