<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/go-git.git/src/flag, branch dev.link</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>all: update references to symbols moved from io/ioutil to io</title>
<updated>2020-10-20T18:41:18+00:00</updated>
<author>
<name>Russ Cox</name>
<email>rsc@golang.org</email>
</author>
<published>2020-10-16T04:49:02+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=1b09d430678d4a6f73b2443463d11f75851aba8a'/>
<id>1b09d430678d4a6f73b2443463d11f75851aba8a</id>
<content type='text'>
The old ioutil references are still valid, but update our code
to reflect best practices and get used to the new locations.

Code compiled with the bootstrap toolchain
(cmd/asm, cmd/dist, cmd/compile, debug/elf)
must remain Go 1.4-compatible and is excluded.
Also excluded vendored code.

For #41190.

Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/263142
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The old ioutil references are still valid, but update our code
to reflect best practices and get used to the new locations.

Code compiled with the bootstrap toolchain
(cmd/asm, cmd/dist, cmd/compile, debug/elf)
must remain Go 1.4-compatible and is excluded.
Also excluded vendored code.

For #41190.

Change-Id: I6d86f2bf7bc37a9d904b6cee3fe0c7af6d94d5b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/263142
Trust: Russ Cox &lt;rsc@golang.org&gt;
Run-TryBot: Russ Cox &lt;rsc@golang.org&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Emmanuel Odeke &lt;emm.odeke@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: add Func</title>
<updated>2020-09-16T17:13:14+00:00</updated>
<author>
<name>Carl Johnson</name>
<email>me@carlmjohnson.net</email>
</author>
<published>2020-08-27T13:08:44+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=16328513bfb12d96e8f33fc37f816e1441027135'/>
<id>16328513bfb12d96e8f33fc37f816e1441027135</id>
<content type='text'>
Fixes #39557

Change-Id: Ida578f7484335e8c6bf927255f75377eda63b563
GitHub-Last-Rev: b97294f7669c24011e5b093179d65636512a84cd
GitHub-Pull-Request: golang/go#39880
Reviewed-on: https://go-review.googlesource.com/c/go/+/240014
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes #39557

Change-Id: Ida578f7484335e8c6bf927255f75377eda63b563
GitHub-Last-Rev: b97294f7669c24011e5b093179d65636512a84cd
GitHub-Pull-Request: golang/go#39880
Reviewed-on: https://go-review.googlesource.com/c/go/+/240014
Reviewed-by: Russ Cox &lt;rsc@golang.org&gt;
Trust: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: fix TestExitCode on Plan 9</title>
<updated>2020-04-03T17:51:12+00:00</updated>
<author>
<name>David du Colombier</name>
<email>0intro@gmail.com</email>
</author>
<published>2020-04-03T16:57:46+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=e31d741801514f2a008625fd246644d2214f4516'/>
<id>e31d741801514f2a008625fd246644d2214f4516</id>
<content type='text'>
CL 221427 added TestExitCode. This test is failing
on Plan 9 because ExitCode is always equal to 1
on error since Plan 9 use error strings.

This change fixes TestExitCode by checking that
ExitCode is equal to 1 on error instead of the
specific value.

Fixes #38237.

Change-Id: Ie269722e731e275e5bfc51644c1fa6be76525f1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/227158
Run-TryBot: David du Colombier &lt;0intro@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CL 221427 added TestExitCode. This test is failing
on Plan 9 because ExitCode is always equal to 1
on error since Plan 9 use error strings.

This change fixes TestExitCode by checking that
ExitCode is equal to 1 on error instead of the
specific value.

Fixes #38237.

Change-Id: Ie269722e731e275e5bfc51644c1fa6be76525f1f
Reviewed-on: https://go-review.googlesource.com/c/go/+/227158
Run-TryBot: David du Colombier &lt;0intro@gmail.com&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Bryan C. Mills &lt;bcmills@google.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: exit 0 when -h or -help invoked but undefined</title>
<updated>2020-04-03T04:24:39+00:00</updated>
<author>
<name>Shang Jian Ding</name>
<email>sding3@ncsu.edu</email>
</author>
<published>2020-04-03T00:13:08+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=dcf0929de6a12103a8fd7097abd6e797188c366d'/>
<id>dcf0929de6a12103a8fd7097abd6e797188c366d</id>
<content type='text'>
flag treats -h or -help as a special case to print a nice help
message, but exit with a status code of 2. This update makes
that status code 0.

Fixes #37533

Change-Id: I7e0bd29944ce46607fb7cfc6740734f7444a151a
GitHub-Last-Rev: 83f64d757bc3a9957c49caa5de74d05a96724771
GitHub-Pull-Request: golang/go#37530
Reviewed-on: https://go-review.googlesource.com/c/go/+/221427
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
flag treats -h or -help as a special case to print a nice help
message, but exit with a status code of 2. This update makes
that status code 0.

Fixes #37533

Change-Id: I7e0bd29944ce46607fb7cfc6740734f7444a151a
GitHub-Last-Rev: 83f64d757bc3a9957c49caa5de74d05a96724771
GitHub-Pull-Request: golang/go#37530
Reviewed-on: https://go-review.googlesource.com/c/go/+/221427
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: changed flag variable name in package doc, for clarity</title>
<updated>2020-03-03T04:56:11+00:00</updated>
<author>
<name>yuz</name>
<email>re.yuz77777@gmail.com</email>
</author>
<published>2020-03-01T12:35:56+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=5b15941c61f478b8ed08b76a27186527ba73d273'/>
<id>5b15941c61f478b8ed08b76a27186527ba73d273</id>
<content type='text'>
Changed the flag variable name to nFlag instead of flagname,
because flagname was confusing.

Change-Id: I20dd4c4b4f605395d427a125ba4fd14580e5d766
Reviewed-on: https://go-review.googlesource.com/c/go/+/221678
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changed the flag variable name to nFlag instead of flagname,
because flagname was confusing.

Change-Id: I20dd4c4b4f605395d427a125ba4fd14580e5d766
Reviewed-on: https://go-review.googlesource.com/c/go/+/221678
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: update comment to refer to Output, not out</title>
<updated>2020-02-27T23:20:01+00:00</updated>
<author>
<name>Ian Lance Taylor</name>
<email>iant@golang.org</email>
</author>
<published>2020-02-27T19:11:48+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=117826903a526c4d31c628f1a302c1d4799c1666'/>
<id>117826903a526c4d31c628f1a302c1d4799c1666</id>
<content type='text'>
The out method was renamed to Output in CL 70391 for #17628 and #21888.

Fixes #37514

Change-Id: I99be47b5030ccbbf10a056df9fcc3c97cb99b015
Reviewed-on: https://go-review.googlesource.com/c/go/+/221383
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&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 out method was renamed to Output in CL 70391 for #17628 and #21888.

Fixes #37514

Change-Id: I99be47b5030ccbbf10a056df9fcc3c97cb99b015
Reviewed-on: https://go-review.googlesource.com/c/go/+/221383
Run-TryBot: Ian Lance Taylor &lt;iant@golang.org&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>flag: clarify that a flag cannot be re-defined</title>
<updated>2019-11-11T20:07:54+00:00</updated>
<author>
<name>Agniva De Sarker</name>
<email>agnivade@yahoo.co.in</email>
</author>
<published>2019-11-11T06:32:56+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=e9f8d676ae40b0ce35efb5838eec560f7b6cf1fc'/>
<id>e9f8d676ae40b0ce35efb5838eec560f7b6cf1fc</id>
<content type='text'>
Fixes #31694

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

Change-Id: Ifb2ad2dc41c449668c0f6a4d4cfb9b583e5591f2
Reviewed-on: https://go-review.googlesource.com/c/go/+/206126
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>cmd/go: further reduce init work</title>
<updated>2019-03-31T10:49:55+00:00</updated>
<author>
<name>Daniel Martí</name>
<email>mvdan@mvdan.cc</email>
</author>
<published>2019-03-08T18:12:07+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=e6ad619ad673d7484535afd4185209b0e9aa95c8'/>
<id>e6ad619ad673d7484535afd4185209b0e9aa95c8</id>
<content type='text'>
The first biggest offender was crypto/des.init at ~1%. It's
cryptographically broken and the init function is relatively expensive,
which is unfortunate as both crypto/tls and crypto/x509 (and by
extension, cmd/go) import it. Hide the work behind sync.Once.

The second biggest offender was flag.sortFlags at just under 1%, used by
the Visit flagset methods. It allocated two slices, which made a
difference as cmd/go iterates over multiple flagsets during init.
Use a single slice with a direct sort.Interface implementation.

Another big offender is initializing global maps. Reducing this work in
cmd/go/internal/imports and net/textproto gives us close to another
whole 1% in saved work. The former can use map literals, and the latter
can hide the work behind sync.Once.

Finally, compress/flate used newHuffmanBitWriter as part of init, which
allocates many objects and slices. Yet it only used one of the slice
fields. Allocating just that slice saves a surprising ~0.3%, since we
generated a lot of unnecessary garbage.

All in all, these little pieces amount to just over 3% saved CPU time.

name         old time/op  new time/op  delta
ExecGoEnv-8  3.61ms ± 1%  3.50ms ± 0%  -3.02%  (p=0.000 n=10+10)

Updates #26775.
Updates #29382.

Change-Id: I915416e88a874c63235ba512617c8aef35c0ca8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/166459
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The first biggest offender was crypto/des.init at ~1%. It's
cryptographically broken and the init function is relatively expensive,
which is unfortunate as both crypto/tls and crypto/x509 (and by
extension, cmd/go) import it. Hide the work behind sync.Once.

The second biggest offender was flag.sortFlags at just under 1%, used by
the Visit flagset methods. It allocated two slices, which made a
difference as cmd/go iterates over multiple flagsets during init.
Use a single slice with a direct sort.Interface implementation.

Another big offender is initializing global maps. Reducing this work in
cmd/go/internal/imports and net/textproto gives us close to another
whole 1% in saved work. The former can use map literals, and the latter
can hide the work behind sync.Once.

Finally, compress/flate used newHuffmanBitWriter as part of init, which
allocates many objects and slices. Yet it only used one of the slice
fields. Allocating just that slice saves a surprising ~0.3%, since we
generated a lot of unnecessary garbage.

All in all, these little pieces amount to just over 3% saved CPU time.

name         old time/op  new time/op  delta
ExecGoEnv-8  3.61ms ± 1%  3.50ms ± 0%  -3.02%  (p=0.000 n=10+10)

Updates #26775.
Updates #29382.

Change-Id: I915416e88a874c63235ba512617c8aef35c0ca8b
Reviewed-on: https://go-review.googlesource.com/c/go/+/166459
Run-TryBot: Daniel Martí &lt;mvdan@mvdan.cc&gt;
TryBot-Result: Gobot Gobot &lt;gobot@golang.org&gt;
Reviewed-by: Brad Fitzpatrick &lt;bradfitz@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: improve docs for PrintDefaults; clarify how to change output destination</title>
<updated>2019-01-21T05:30:12+00:00</updated>
<author>
<name>Aaron Cannon</name>
<email>cannona@fireantproductions.com</email>
</author>
<published>2018-10-27T16:21:00+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=e308807f658c11af52804d55c1b8c4b2cf80d3f3'/>
<id>e308807f658c11af52804d55c1b8c4b2cf80d3f3</id>
<content type='text'>
The existing docs only mention that it is possible to change the output
destination of PrintDefaults from the default of standard error, but fail to
mention how to actually do so. This change fixes this lack by directing users
to CommandLine.SetOutput.

Fixes #15024

Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3
Reviewed-on: https://go-review.googlesource.com/c/145203
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The existing docs only mention that it is possible to change the output
destination of PrintDefaults from the default of standard error, but fail to
mention how to actually do so. This change fixes this lack by directing users
to CommandLine.SetOutput.

Fixes #15024

Change-Id: Ieaa7edbebd23d4ea6fa7e53d97a87143d590bdb3
Reviewed-on: https://go-review.googlesource.com/c/145203
Reviewed-by: Rob Pike &lt;r@golang.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>flag: return a consistent parse error if the flag value is invalid</title>
<updated>2018-10-19T03:48:38+00:00</updated>
<author>
<name>Rob Pike</name>
<email>r@golang.org</email>
</author>
<published>2018-10-18T23:48:53+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/go-git.git/commit/?id=ae0c435877d3aacb9af5e706c40f9dddde5d3e67'/>
<id>ae0c435877d3aacb9af5e706c40f9dddde5d3e67</id>
<content type='text'>
Return a consistently formatted error string that reports either
a parse error or a range error.

Before:
	invalid boolean value "3" for -debug: strconv.ParseBool: parsing "3": invalid syntax

After:
	invalid boolean value "3" for -debug: parse error

Fixes #26822

Change-Id: I60992bf23da32a4c0cf32472a8af486a3c9674ad
Reviewed-on: https://go-review.googlesource.com/c/143257
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Return a consistently formatted error string that reports either
a parse error or a range error.

Before:
	invalid boolean value "3" for -debug: strconv.ParseBool: parsing "3": invalid syntax

After:
	invalid boolean value "3" for -debug: parse error

Fixes #26822

Change-Id: I60992bf23da32a4c0cf32472a8af486a3c9674ad
Reviewed-on: https://go-review.googlesource.com/c/143257
Reviewed-by: Ian Lance Taylor &lt;iant@golang.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
