<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/fmt/doc.go, branch dev.ssa</title>
<subtitle>github.com: golang/go
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/'/>
<entry>
<title>fmt: remove extra space in too few arguments example</title>
<updated>2016-05-12T20:45:48+00:00</updated>
<author>
<name>Mohit Agarwal</name>
<email>mohit@sdf.org</email>
</author>
<published>2016-05-12T20:35:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=8f48efb31c7cdddeec7d4221174254466b0891dd'/>
<id>8f48efb31c7cdddeec7d4221174254466b0891dd</id>
<content type='text'>
Change-Id: Iae4855c52c4da9755277251d22121226507ea26a
Reviewed-on: https://go-review.googlesource.com/23074
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change-Id: Iae4855c52c4da9755277251d22121226507ea26a
Reviewed-on: https://go-review.googlesource.com/23074
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: remove extra space in doc for compound objects</title>
<updated>2016-04-17T20:07:32+00:00</updated>
<author>
<name>Emmanuel Odeke</name>
<email>emm.odeke@gmail.com</email>
</author>
<published>2016-04-17T18:24:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=5c434e93a16fae3edc4f0494bc796eb80bfbd0b2'/>
<id>5c434e93a16fae3edc4f0494bc796eb80bfbd0b2</id>
<content type='text'>
Fixes #15339

Change-Id: I0b006deefb58ccfc47beae4e1b8da3d77fafda6b
Reviewed-on: https://go-review.googlesource.com/22148
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #15339

Change-Id: I0b006deefb58ccfc47beae4e1b8da3d77fafda6b
Reviewed-on: https://go-review.googlesource.com/22148
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: clarify that for %g precision determines number of significant digits</title>
<updated>2016-04-14T00:13:10+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2016-04-13T18:47:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=933d521a7aa5defc46d3336bcb71a2f3f2b8172d'/>
<id>933d521a7aa5defc46d3336bcb71a2f3f2b8172d</id>
<content type='text'>
Documentation change only.

Fixes #15178.

Change-Id: I3c7d80ce9e668ac7515f7ebb9da80f3bd8e534d6
Reviewed-on: https://go-review.googlesource.com/22006
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Documentation change only.

Fixes #15178.

Change-Id: I3c7d80ce9e668ac7515f7ebb9da80f3bd8e534d6
Reviewed-on: https://go-review.googlesource.com/22006
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: clarify reflect.Value printing</title>
<updated>2015-10-19T18:29:36+00:00</updated>
<author>
<name>Nodir Turakulov</name>
<email>nodir@google.com</email>
</author>
<published>2015-10-16T08:33:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=1da6b2ea197c9fcaa50e9465f3bf40c78b14703c'/>
<id>1da6b2ea197c9fcaa50e9465f3bf40c78b14703c</id>
<content type='text'>
fmt docs say:

  If the operand is a reflect.Value, the concrete value it
  holds is printed as if it was the operand.

It implies recursive application of this rule, which is not the case.
Clarify the docs.

Change-Id: I019277c7c6439095bab83e5536aa06403638aa51
Reviewed-on: https://go-review.googlesource.com/15952
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
fmt docs say:

  If the operand is a reflect.Value, the concrete value it
  holds is printed as if it was the operand.

It implies recursive application of this rule, which is not the case.
Clarify the docs.

Change-Id: I019277c7c6439095bab83e5536aa06403638aa51
Reviewed-on: https://go-review.googlesource.com/15952
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: fix scientific notation in docs</title>
<updated>2015-08-31T18:43:00+00:00</updated>
<author>
<name>Shenghou Ma</name>
<email>minux@golang.org</email>
</author>
<published>2015-08-26T21:52:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=24e4cd9eb6357105027a4c580a311e84b00273ba'/>
<id>24e4cd9eb6357105027a4c580a311e84b00273ba</id>
<content type='text'>
Fixes #12340.

Change-Id: I17a8b3711a8593ec60882a0dcadb38f0cc138f4b
Reviewed-on: https://go-review.googlesource.com/13949
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #12340.

Change-Id: I17a8b3711a8593ec60882a0dcadb38f0cc138f4b
Reviewed-on: https://go-review.googlesource.com/13949
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: restore padding for %x on byte slices and strings</title>
<updated>2015-06-29T07:17:23+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-06-27T01:07:30+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a76c1a5c7fb704e5658bbbe9f27b4301b86bfd80'/>
<id>a76c1a5c7fb704e5658bbbe9f27b4301b86bfd80</id>
<content type='text'>
Also improve the documentation. A prior fix in this release
changed the properties for empty strings and slices, incorrectly.
Previous behavior is now restored and better documented.

Add lots of tests.

The behavior is that when using a string-like format (%s %q %x %X)
a byte slice is equivalent to a string, and printed as a unit. The padding
applies to the entire object. (The space and sharp flags apply
elementwise.)

Fixes #11422.
Fixes #10430.

Change-Id: I758f0521caf71630437e43990ec6d6c9a92655e3
Reviewed-on: https://go-review.googlesource.com/11600
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Also improve the documentation. A prior fix in this release
changed the properties for empty strings and slices, incorrectly.
Previous behavior is now restored and better documented.

Add lots of tests.

The behavior is that when using a string-like format (%s %q %x %X)
a byte slice is equivalent to a string, and printed as a unit. The padding
applies to the entire object. (The space and sharp flags apply
elementwise.)

Fixes #11422.
Fixes #10430.

Change-Id: I758f0521caf71630437e43990ec6d6c9a92655e3
Reviewed-on: https://go-review.googlesource.com/11600
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: scanning widths apply after leading spaces</title>
<updated>2015-06-13T04:33:26+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-06-12T23:17:08+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=a1fe3b5046d9f7249c04ce942f4d2d1d771bff40'/>
<id>a1fe3b5046d9f7249c04ce942f4d2d1d771bff40</id>
<content type='text'>
When scanning with a width, as in %5s, C skips leading spaces
brefore counting the 5 characters. We should do the same.

Reword the documentation about widths to make this clear.

Fixes #9444

Change-Id: I443a6441adcf1c834057ef3977f9116a987a79cd
Reviewed-on: https://go-review.googlesource.com/10997
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When scanning with a width, as in %5s, C skips leading spaces
brefore counting the 5 characters. We should do the same.

Reword the documentation about widths to make this clear.

Fixes #9444

Change-Id: I443a6441adcf1c834057ef3977f9116a987a79cd
Reviewed-on: https://go-review.googlesource.com/10997
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: require newlines to match when scanning with a format</title>
<updated>2015-06-12T20:14:14+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-06-05T21:23:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=57f4b43078e5f24a08088fb5ef91bc9f0e432015'/>
<id>57f4b43078e5f24a08088fb5ef91bc9f0e432015</id>
<content type='text'>
The documentation says that newlines behave like this:

Scan etc.: newlines are spaces.
Scanln etc.: newlines terminate the scan.
Scanf etc.: newlines must match in input and format.

The code did not implement this behavior in all cases,
especially for Scanf. Make it behave:

- Fix the handling of spaces and newlines in ss.Advance.
The code is longer but now behaves as it should.

- Delete the reuse of the current ss in newScanState.
There is really no need, since it's only used in recursive
calls to Scan etc., and the flags are likely wrong. Simpler
just to allocate a new one every time, and likelier to
be correct.

Fixes #10862.

Change-Id: If060ac021017346723b0d62de4e5a305da898f68
Reviewed-on: https://go-review.googlesource.com/10991
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The documentation says that newlines behave like this:

Scan etc.: newlines are spaces.
Scanln etc.: newlines terminate the scan.
Scanf etc.: newlines must match in input and format.

The code did not implement this behavior in all cases,
especially for Scanf. Make it behave:

- Fix the handling of spaces and newlines in ss.Advance.
The code is longer but now behaves as it should.

- Delete the reuse of the current ss in newScanState.
There is really no need, since it's only used in recursive
calls to Scan etc., and the flags are likely wrong. Simpler
just to allocate a new one every time, and likelier to
be correct.

Fixes #10862.

Change-Id: If060ac021017346723b0d62de4e5a305da898f68
Reviewed-on: https://go-review.googlesource.com/10991
Reviewed-by: Andrew Gerrand &lt;adg@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: treat reflect.Value specially - as the value it holds</title>
<updated>2015-04-15T15:59:39+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-04-09T23:30:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=049b89dc6f6b6f1001672dd5456197b74a97cbec'/>
<id>049b89dc6f6b6f1001672dd5456197b74a97cbec</id>
<content type='text'>
When a reflect.Value is passed to Printf (etc.), fmt called the
String method, which does not disclose its contents. To get the
contents, one could call Value.Interface(), but that is illegal
if the Value is not exported or otherwise forbidden.

This CL improves the situation with a trivial change to the
fmt package: when we see a reflect.Value as an argument,
we treat it exactly as we treat a reflect.Value we make inside
the package. This means that we always print the
contents of the Value as if _that_ was the argument to Printf.

This is arguably a breaking change but I think it is a genuine
improvement and no greater a break than many other tweaks
we have made to formatted output from this package.

Fixes #8965.

Change-Id: Ifc2a4ce3c1134ad5160e101d2196c22f1542faab
Reviewed-on: https://go-review.googlesource.com/8731
Reviewed-by: roger peppe &lt;rogpeppe@gmail.com&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a reflect.Value is passed to Printf (etc.), fmt called the
String method, which does not disclose its contents. To get the
contents, one could call Value.Interface(), but that is illegal
if the Value is not exported or otherwise forbidden.

This CL improves the situation with a trivial change to the
fmt package: when we see a reflect.Value as an argument,
we treat it exactly as we treat a reflect.Value we make inside
the package. This means that we always print the
contents of the Value as if _that_ was the argument to Printf.

This is arguably a breaking change but I think it is a genuine
improvement and no greater a break than many other tweaks
we have made to formatted output from this package.

Fixes #8965.

Change-Id: Ifc2a4ce3c1134ad5160e101d2196c22f1542faab
Reviewed-on: https://go-review.googlesource.com/8731
Reviewed-by: roger peppe &lt;rogpeppe@gmail.com&gt;
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>fmt: document existing behavior of nil receivers</title>
<updated>2015-03-01T18:17:53+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2015-03-01T16:56:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/go-git.git/commit/?id=3ee9df799fc76e06b216248735e530dd4e1dc504'/>
<id>3ee9df799fc76e06b216248735e530dd4e1dc504</id>
<content type='text'>
If a method called by fmt triggers a panic, the output usually says
so. However, there is heretofore undocumented special treatment for
a panic caused by formatting a nil value with an Error or String
method: the output is simply "&lt;nil&gt;". Document that behavior.

Change-Id: Id0f79dd0b3487f9d1c74a0856727bba5cc342be4
Reviewed-on: https://go-review.googlesource.com/6410
Reviewed-by: David Crawshaw &lt;crawshaw@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a method called by fmt triggers a panic, the output usually says
so. However, there is heretofore undocumented special treatment for
a panic caused by formatting a nil value with an Error or String
method: the output is simply "&lt;nil&gt;". Document that behavior.

Change-Id: Id0f79dd0b3487f9d1c74a0856727bba5cc342be4
Reviewed-on: https://go-review.googlesource.com/6410
Reviewed-by: David Crawshaw &lt;crawshaw@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
