<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/cmd/doc/pkg.go, branch dev.inline</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/'/>
<entry>
<title>cmd/doc: show documentation for interface methods when requested explicitly</title>
<updated>2016-10-25T20:09:49+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2016-10-24T19:38:06+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=2ee82edfc2c904c952daef6f442c223b1568cb66'/>
<id>2ee82edfc2c904c952daef6f442c223b1568cb66</id>
<content type='text'>
For historical reasons, the go/doc package does not include
the methods within an interface as part of the documented
methods for that type. Thus,

	go doc ast.Node.Pos

gives an incorrect and confusing error message:

	doc: no method Node.Pos in package go/ast

This CL does some dirty work to dig down to the methods
so interface methods now present their documentation:

% go doc ast.node.pos
func Pos() token.Pos  // position of first character belonging to the node
%

It must largely sidestep the doc package to do this, which
is a shame. Perhaps things will improve there one day.

The change does not handle embeddings, and in principle the
same approach could be done for struct fields, but that is also
not here yet. But this CL fixes the thing that was bugging me.

Change-Id: Ic10a91936da96f54ee0b2f4a4fe4a8c9b93a5b4a
Reviewed-on: https://go-review.googlesource.com/31852
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For historical reasons, the go/doc package does not include
the methods within an interface as part of the documented
methods for that type. Thus,

	go doc ast.Node.Pos

gives an incorrect and confusing error message:

	doc: no method Node.Pos in package go/ast

This CL does some dirty work to dig down to the methods
so interface methods now present their documentation:

% go doc ast.node.pos
func Pos() token.Pos  // position of first character belonging to the node
%

It must largely sidestep the doc package to do this, which
is a shame. Perhaps things will improve there one day.

The change does not handle embeddings, and in principle the
same approach could be done for struct fields, but that is also
not here yet. But this CL fixes the thing that was bugging me.

Change-Id: Ic10a91936da96f54ee0b2f4a4fe4a8c9b93a5b4a
Reviewed-on: https://go-review.googlesource.com/31852
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: ensure summaries truly are only one line</title>
<updated>2016-10-05T00:12:35+00:00</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2016-08-03T07:31:17+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=84743c348b0a4a7ed1ea3d7122feb757ccc7ebae'/>
<id>84743c348b0a4a7ed1ea3d7122feb757ccc7ebae</id>
<content type='text'>
The documentation for doc says:
&gt; Doc prints the documentation comments associated with the item identified by its
&gt; arguments (a package, const, func, type, var, or method) followed by a one-line
&gt; summary of each of the first-level items "under" that item (package-level
&gt; declarations for a package, methods for a type, etc.).

Certain variables (and constants, functions, and types) have value specifications
that are multiple lines long. Prior to this change, doc would print out all of the
lines necessary to display the value. This is inconsistent with the documented
behavior, which guarantees a one-line summary for all first-level items.
We fix this here by writing a general oneLineNode method that always returns
a one-line summary (guaranteed!) of any input node.

Packages like image/color/palette and unicode now become much
more readable since large slices are now a single line.

$ go doc image/color/palette
&lt;&lt;&lt;
// Before:
var Plan9 = []color.Color{
	color.RGBA{0x00, 0x00, 0x00, 0xff},
	color.RGBA{0x00, 0x00, 0x44, 0xff},
	color.RGBA{0x00, 0x00, 0x88, 0xff},
	... // Hundreds of more lines!
}
var WebSafe = []color.Color{
	color.RGBA{0x00, 0x00, 0x00, 0xff},
	color.RGBA{0x00, 0x00, 0x33, 0xff},
	color.RGBA{0x00, 0x00, 0x66, 0xff},
	... // Hundreds of more lines!
}

// After:
var Plan9 = []color.Color{ ... }
var WebSafe = []color.Color{ ... }
&gt;&gt;&gt;

In order to test this, I ran `go doc` and `go doc -u` on all of the
standard library packages and diff'd the output with and without the
change to ensure that all differences were intended.

Fixes #13072

Change-Id: Ida10b7796b7e4e174a929b55c60813a9eb7158fe
Reviewed-on: https://go-review.googlesource.com/25420
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The documentation for doc says:
&gt; Doc prints the documentation comments associated with the item identified by its
&gt; arguments (a package, const, func, type, var, or method) followed by a one-line
&gt; summary of each of the first-level items "under" that item (package-level
&gt; declarations for a package, methods for a type, etc.).

Certain variables (and constants, functions, and types) have value specifications
that are multiple lines long. Prior to this change, doc would print out all of the
lines necessary to display the value. This is inconsistent with the documented
behavior, which guarantees a one-line summary for all first-level items.
We fix this here by writing a general oneLineNode method that always returns
a one-line summary (guaranteed!) of any input node.

Packages like image/color/palette and unicode now become much
more readable since large slices are now a single line.

$ go doc image/color/palette
&lt;&lt;&lt;
// Before:
var Plan9 = []color.Color{
	color.RGBA{0x00, 0x00, 0x00, 0xff},
	color.RGBA{0x00, 0x00, 0x44, 0xff},
	color.RGBA{0x00, 0x00, 0x88, 0xff},
	... // Hundreds of more lines!
}
var WebSafe = []color.Color{
	color.RGBA{0x00, 0x00, 0x00, 0xff},
	color.RGBA{0x00, 0x00, 0x33, 0xff},
	color.RGBA{0x00, 0x00, 0x66, 0xff},
	... // Hundreds of more lines!
}

// After:
var Plan9 = []color.Color{ ... }
var WebSafe = []color.Color{ ... }
&gt;&gt;&gt;

In order to test this, I ran `go doc` and `go doc -u` on all of the
standard library packages and diff'd the output with and without the
change to ensure that all differences were intended.

Fixes #13072

Change-Id: Ida10b7796b7e4e174a929b55c60813a9eb7158fe
Reviewed-on: https://go-review.googlesource.com/25420
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: perform type grouping for constants and variables</title>
<updated>2016-09-30T23:40:48+00:00</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2016-08-03T01:42:58+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=eca4e446115be5653a3963c37459a263569390c5'/>
<id>eca4e446115be5653a3963c37459a263569390c5</id>
<content type='text'>
In golang.org/cl/22354, we added functionality to group functions under the
type that they construct to. In this CL, we extend the same concept to
constants and variables. This makes the doc tool more consistent with what
the godoc website does.

$ go doc reflect | egrep "ChanDir|Kind|SelectDir"
&lt;&lt;&lt;
// Before:
const RecvDir ChanDir = 1 &lt;&lt; iota ...
const Invalid Kind = iota ...
type ChanDir int
type Kind uint
type SelectDir int
    func ChanOf(dir ChanDir, t Type) Type

// After:
type ChanDir int
    const RecvDir ChanDir = 1 &lt;&lt; iota ...
type Kind uint
    const Invalid Kind = iota ...
type SelectDir int
    const SelectSend SelectDir ...
    func ChanOf(dir ChanDir, t Type) Type
&gt;&gt;&gt;

Furthermore, a fix was made to ensure that the type was printed in constant
blocks when the iota was applied on an unexported field.

$ go doc reflect SelectSend
&lt;&lt;&lt;
// Before:
const (
	SelectSend    // case Chan &lt;- Send
	SelectRecv    // case &lt;-Chan:
	SelectDefault // default
)

// After:
const (
	SelectSend    SelectDir // case Chan &lt;- Send
	SelectRecv              // case &lt;-Chan:
	SelectDefault           // default
)
&gt;&gt;&gt;

Fixes #16569

Change-Id: I26124c3d19e50caf9742bb936803a665e0fa6512
Reviewed-on: https://go-review.googlesource.com/25419
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In golang.org/cl/22354, we added functionality to group functions under the
type that they construct to. In this CL, we extend the same concept to
constants and variables. This makes the doc tool more consistent with what
the godoc website does.

$ go doc reflect | egrep "ChanDir|Kind|SelectDir"
&lt;&lt;&lt;
// Before:
const RecvDir ChanDir = 1 &lt;&lt; iota ...
const Invalid Kind = iota ...
type ChanDir int
type Kind uint
type SelectDir int
    func ChanOf(dir ChanDir, t Type) Type

// After:
type ChanDir int
    const RecvDir ChanDir = 1 &lt;&lt; iota ...
type Kind uint
    const Invalid Kind = iota ...
type SelectDir int
    const SelectSend SelectDir ...
    func ChanOf(dir ChanDir, t Type) Type
&gt;&gt;&gt;

Furthermore, a fix was made to ensure that the type was printed in constant
blocks when the iota was applied on an unexported field.

$ go doc reflect SelectSend
&lt;&lt;&lt;
// Before:
const (
	SelectSend    // case Chan &lt;- Send
	SelectRecv    // case &lt;-Chan:
	SelectDefault // default
)

// After:
const (
	SelectSend    SelectDir // case Chan &lt;- Send
	SelectRecv              // case &lt;-Chan:
	SelectDefault           // default
)
&gt;&gt;&gt;

Fixes #16569

Change-Id: I26124c3d19e50caf9742bb936803a665e0fa6512
Reviewed-on: https://go-review.googlesource.com/25419
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: ensure functions with unexported return values are shown</title>
<updated>2016-08-02T03:24:48+00:00</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2016-08-02T03:04:25+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=6317c213c953d0879fe88593b4372f03d25f369b'/>
<id>6317c213c953d0879fe88593b4372f03d25f369b</id>
<content type='text'>
The commit in golang.org/cl/22354 groups constructors functions under
the type that they construct to. However, this caused a minor regression
where functions that had unexported return values were not being printed
at all. Thus, we forgo the grouping logic if the type the constructor falls
under is not going to be printed.

Fixes #16568

Change-Id: Idc14f5d03770282a519dc22187646bda676af612
Reviewed-on: https://go-review.googlesource.com/25369
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The commit in golang.org/cl/22354 groups constructors functions under
the type that they construct to. However, this caused a minor regression
where functions that had unexported return values were not being printed
at all. Thus, we forgo the grouping logic if the type the constructor falls
under is not going to be printed.

Fixes #16568

Change-Id: Idc14f5d03770282a519dc22187646bda676af612
Reviewed-on: https://go-review.googlesource.com/25369
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: handle embedded interfaces properly</title>
<updated>2016-08-02T01:58:14+00:00</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2016-08-01T21:33:19+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=f5758739a8f011c1d146a7736ab8f0d2834e1783'/>
<id>f5758739a8f011c1d146a7736ab8f0d2834e1783</id>
<content type='text'>
Changes made:
* Disallow star expression on interfaces as this is not possible.
* Show an embedded "error" in an interface as public similar to
how godoc does it.
* Properly handle selector expressions in both structs and interfaces.
This is possible since a type may refer to something defined in
another package (e.g. io.Reader).

Before:
&lt;&lt;&lt;
$ go doc runtime.Error
type Error interface {

    // RuntimeError is a no-op function but
    // serves to distinguish types that are run time
    // errors from ordinary errors: a type is a
    // run time error if it has a RuntimeError method.
    RuntimeError()
    // Has unexported methods.
}

$ go doc compress/flate Reader
doc: invalid program: unexpected type for embedded field
doc: invalid program: unexpected type for embedded field
type Reader interface {
    io.Reader
    io.ByteReader
}
&gt;&gt;&gt;

After:
&lt;&lt;&lt;
$ go doc runtime.Error
type Error interface {
    error

    // RuntimeError is a no-op function but
    // serves to distinguish types that are run time
    // errors from ordinary errors: a type is a
    // run time error if it has a RuntimeError method.
    RuntimeError()
}

$ go doc compress/flate Reader
type Reader interface {
    io.Reader
    io.ByteReader
}
&gt;&gt;&gt;

Fixes #16567

Change-Id: I272dede971eee9f43173966233eb8810e4a8c907
Reviewed-on: https://go-review.googlesource.com/25365
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changes made:
* Disallow star expression on interfaces as this is not possible.
* Show an embedded "error" in an interface as public similar to
how godoc does it.
* Properly handle selector expressions in both structs and interfaces.
This is possible since a type may refer to something defined in
another package (e.g. io.Reader).

Before:
&lt;&lt;&lt;
$ go doc runtime.Error
type Error interface {

    // RuntimeError is a no-op function but
    // serves to distinguish types that are run time
    // errors from ordinary errors: a type is a
    // run time error if it has a RuntimeError method.
    RuntimeError()
    // Has unexported methods.
}

$ go doc compress/flate Reader
doc: invalid program: unexpected type for embedded field
doc: invalid program: unexpected type for embedded field
type Reader interface {
    io.Reader
    io.ByteReader
}
&gt;&gt;&gt;

After:
&lt;&lt;&lt;
$ go doc runtime.Error
type Error interface {
    error

    // RuntimeError is a no-op function but
    // serves to distinguish types that are run time
    // errors from ordinary errors: a type is a
    // run time error if it has a RuntimeError method.
    RuntimeError()
}

$ go doc compress/flate Reader
type Reader interface {
    io.Reader
    io.ByteReader
}
&gt;&gt;&gt;

Fixes #16567

Change-Id: I272dede971eee9f43173966233eb8810e4a8c907
Reviewed-on: https://go-review.googlesource.com/25365
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
Run-TryBot: Joe Tsai &lt;thebrokentoaster@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: group constructors with type in package presentation</title>
<updated>2016-04-21T21:45:05+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2016-04-21T20:29:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=a33e9cf7ead3d7853546a71796a6c404d02cb474'/>
<id>a33e9cf7ead3d7853546a71796a6c404d02cb474</id>
<content type='text'>
Fixes #14004.

$ go doc encoding.gob
Before:
func Register(value interface{})
func RegisterName(name string, value interface{})
func NewDecoder(r io.Reader) *Decoder
func NewEncoder(w io.Writer) *Encoder
type CommonType struct { ... }
type Decoder struct { ... }
type Encoder struct { ... }
type GobDecoder interface { ... }
type GobEncoder interface { ... }

After:
func Register(value interface{})
func RegisterName(name string, value interface{})
type CommonType struct { ... }
type Decoder struct { ... }
    func NewDecoder(r io.Reader) *Decoder
type Encoder struct { ... }
    func NewEncoder(w io.Writer) *Encoder
type GobDecoder interface { ... }
type GobEncoder interface { ... }

Change-Id: I021db25bce4a16b3dfa22ab323ca1f4e68d50111
Reviewed-on: https://go-review.googlesource.com/22354
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #14004.

$ go doc encoding.gob
Before:
func Register(value interface{})
func RegisterName(name string, value interface{})
func NewDecoder(r io.Reader) *Decoder
func NewEncoder(w io.Writer) *Encoder
type CommonType struct { ... }
type Decoder struct { ... }
type Encoder struct { ... }
type GobDecoder interface { ... }
type GobEncoder interface { ... }

After:
func Register(value interface{})
func RegisterName(name string, value interface{})
type CommonType struct { ... }
type Decoder struct { ... }
    func NewDecoder(r io.Reader) *Decoder
type Encoder struct { ... }
    func NewEncoder(w io.Writer) *Encoder
type GobDecoder interface { ... }
type GobEncoder interface { ... }

Change-Id: I021db25bce4a16b3dfa22ab323ca1f4e68d50111
Reviewed-on: https://go-review.googlesource.com/22354
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>all: delete dead non-test code</title>
<updated>2016-03-25T06:28:13+00:00</updated>
<author>
<name>Dominik Honnef</name>
<email>dominik@honnef.co</email>
</author>
<published>2016-03-20T23:12:18+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=fdba5a7544e54227c910ae3b26511c718df786a1'/>
<id>fdba5a7544e54227c910ae3b26511c718df786a1</id>
<content type='text'>
This change removes a lot of dead code. Some of the code has never been
used, not even when it was first commited. The rest shouldn't have
survived refactors.

This change doesn't remove unused routines helpful for debugging, nor
does it remove code that's used in commented out blocks of code that are
only unused temporarily. Furthermore, unused constants weren't removed
when they were part of a set of constants from specifications.

One noteworthy omission from this CL are about 1000 lines of unused code
in cmd/fix, 700 lines of which are the typechecker, which hasn't been
used ever since the pre-Go 1 fixes have been removed. I wasn't sure if
this code should stick around for future uses of cmd/fix or be culled as
well.

Change-Id: Ib714bc7e487edc11ad23ba1c3222d1fd02e4a549
Reviewed-on: https://go-review.googlesource.com/20926
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change removes a lot of dead code. Some of the code has never been
used, not even when it was first commited. The rest shouldn't have
survived refactors.

This change doesn't remove unused routines helpful for debugging, nor
does it remove code that's used in commented out blocks of code that are
only unused temporarily. Furthermore, unused constants weren't removed
when they were part of a set of constants from specifications.

One noteworthy omission from this CL are about 1000 lines of unused code
in cmd/fix, 700 lines of which are the typechecker, which hasn't been
used ever since the pre-Go 1 fixes have been removed. I wasn't sure if
this code should stick around for future uses of cmd/fix or be culled as
well.

Change-Id: Ib714bc7e487edc11ad23ba1c3222d1fd02e4a549
Reviewed-on: https://go-review.googlesource.com/20926
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
Run-TryBot: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: handle embedded fields properly</title>
<updated>2016-02-22T23:40:02+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2016-02-19T05:36:03+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=108218453a2cd26920f9be899b4a5102e80007a8'/>
<id>108218453a2cd26920f9be899b4a5102e80007a8</id>
<content type='text'>
The structure of the code meant that an embedded field was never
checked for export status. We need to check the name of the type,
which is either of type T or type *T, and T might be unexported.

Fixes #14356.

Change-Id: I56f468e9b8ae67e9ed7509ed0b91d860507baed2
Reviewed-on: https://go-review.googlesource.com/19701
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The structure of the code meant that an embedded field was never
checked for export status. We need to check the name of the type,
which is either of type T or type *T, and T might be unexported.

Fixes #14356.

Change-Id: I56f468e9b8ae67e9ed7509ed0b91d860507baed2
Reviewed-on: https://go-review.googlesource.com/19701
Reviewed-by: Robert Griesemer &lt;gri@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: fix strange indentation artifacts with unexported fields</title>
<updated>2015-11-17T20:51:19+00:00</updated>
<author>
<name>Joe Tsai</name>
<email>joetsai@digital-static.net</email>
</author>
<published>2015-10-24T00:09:39+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=07d48993f257a6536d83555bb8cc9daffa07dd56'/>
<id>07d48993f257a6536d83555bb8cc9daffa07dd56</id>
<content type='text'>
The NamePos value was not being set, and would default to a value
of zero. This would cause the printing logic to get confused as
to where exactly to place the "Has unexported fields" string.

A trivial package changes from

&lt;
type A struct {
	A int // A
	B int
			// B
	// Has unexported fields.
}
&gt;

to

&lt;
type A struct {
	A int // A
	B int // B
	// Has unexported fields.
}
&gt;

Fixes #12971

Change-Id: I53b7799a1f1c0ad7dcaddff83d9aaeb1d6b7823e
Reviewed-on: https://go-review.googlesource.com/16286
Run-TryBot: Joe Tsai &lt;joetsai@digital-static.net&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The NamePos value was not being set, and would default to a value
of zero. This would cause the printing logic to get confused as
to where exactly to place the "Has unexported fields" string.

A trivial package changes from

&lt;
type A struct {
	A int // A
	B int
			// B
	// Has unexported fields.
}
&gt;

to

&lt;
type A struct {
	A int // A
	B int // B
	// Has unexported fields.
}
&gt;

Fixes #12971

Change-Id: I53b7799a1f1c0ad7dcaddff83d9aaeb1d6b7823e
Reviewed-on: https://go-review.googlesource.com/16286
Run-TryBot: Joe Tsai &lt;joetsai@digital-static.net&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/doc: fix pretty printing of paths</title>
<updated>2015-09-29T02:18:57+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-09-28T20:45:57+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=0722a5e71848f62363f71eac4696469cea754b83'/>
<id>0722a5e71848f62363f71eac4696469cea754b83</id>
<content type='text'>
The code to strip GOROOT and GOPATH had a bug: it assumed there
were bytes after the GOROOT prefix but there might not be.
Fix this and other issues by taking care the prefix is really a
file name prefix for the path, not just a string prefix, and
handle the case where GOROOT==path.

Change-Id: I8066865fd05f938bb6dbf3bb8ab1fc58e5cf6bb5
Reviewed-on: https://go-review.googlesource.com/15112
Run-TryBot: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code to strip GOROOT and GOPATH had a bug: it assumed there
were bytes after the GOROOT prefix but there might not be.
Fix this and other issues by taking care the prefix is really a
file name prefix for the path, not just a string prefix, and
handle the case where GOROOT==path.

Change-Id: I8066865fd05f938bb6dbf3bb8ab1fc58e5cf6bb5
Reviewed-on: https://go-review.googlesource.com/15112
Run-TryBot: Rob Pike &lt;r@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
