1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:18:32 -06:00
go/cmd
Daniel Martí bd4635fd25 cmd/stringer: use strconv instead of fmt
In the generated code, we want to pull in as few dependencies as
possible. fmt is heavier than strconv, and the latter can be used with a
bit of extra code for the same results.

More importantly, this will allow stringer to be used in some std
packages that cannot import fmt, such as regexp/syntax. While strconv
lies in L2 in deps_test.go, fmt lies in L4.

This means that many other packages will also be able to use stringer
where it could be useful, such as path/filepath, os/exec, or io/ioutil.

Since some of these types may be 64-bit integers, use FormatInt instead
of Itoa to avoid overflows with int on 32-bit.

Also double-checked that the generated code is still formatted properly.

Change-Id: Iffb3bd2df5c94407705689719240aca0c7474a89
Reviewed-on: https://go-review.googlesource.com/77473
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2017-11-14 15:22:39 +00:00
..
benchcmp benchmark/parser, cmd/benchcmp: improve names of exported identifiers 2015-01-15 01:28:17 +00:00
bundle cmd/bundle: include non-associated comments 2017-07-07 17:27:36 +00:00
callgraph cmd/callgraph: fix "import path of the enclosing package" example in usage 2017-08-08 14:46:45 +00:00
compilebench cmd/compilebench: use go command in goroot, not environment 2017-05-09 19:43:46 +00:00
cover cmd/cover: check os.Create error im html output 2017-01-08 00:00:17 +00:00
digraph tools: add import comments. 2014-12-09 22:42:16 +00:00
eg cmd/eg: Gofmt eg's dry-run output. 2017-07-13 04:09:46 +00:00
fiximports cmd/godoc, cmd/fiximports: fix or skip failing tests at tip 2016-10-12 15:24:30 +00:00
getgo cmd/getgo: fix vet failure caused by missing argument to Errorf call. 2017-11-06 15:28:13 +00:00
go-contrib-init cmd/go-contrib-init: exit with an error if package install fails 2017-07-17 03:20:55 +00:00
godex cmd/godex: handle printing of type aliases 2017-01-11 21:17:45 +00:00
godoc cmd/godoc: fix expected test output for Go 1.8 and older 2017-04-26 05:21:38 +00:00
goimports imports: fix reading from stdin on Windows 2017-07-07 17:20:05 +00:00
gomvpkg go/buildutil: TagsFlag provides a flag.Value for setting build.Context.BuildTags from -tags flag. 2015-04-23 14:10:21 +00:00
gorename cmd/gorename: fix test failure formatting. 2017-11-06 14:18:16 +00:00
gotype gotype: fix default importer for Go 1.8. 2017-04-10 16:28:46 +00:00
goyacc cmd/goyacc: remove empty branch 2017-03-15 21:33:42 +00:00
guru cmd/guru: fix and reenable failing test case 2017-04-14 23:25:34 +00:00
heapview cmd/heapview: look for tools repository in all GOPATH entries 2017-04-10 18:12:01 +00:00
html2article x/tools/cmd/html2article: remove unused functions 2017-03-01 14:53:04 +00:00
present present: Scale down slides on smaller displays 2017-08-31 21:56:44 +00:00
ssadump tools: updates for minimum Go version 1.6 2017-02-07 21:06:19 +00:00
stress cmd/stress: flush out Usage doc 2017-06-12 21:12:06 +00:00
stringer cmd/stringer: use strconv instead of fmt 2017-11-14 15:22:39 +00:00
tip cmd/tip: fix the build 2017-08-01 18:51:51 +00:00
toolstash cmd/toolstash: don't try comparing "asm -V=full" output. 2017-11-02 22:54:56 +00:00