Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(27)

Issue 135450044: code review 135450044: go.tools/cmd/stringer: use const for names, slice for m... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 7 months ago by r
Modified:
10 years, 7 months ago
Reviewers:
gri
CC:
golang-codereviews
Visibility:
Public.

Description

go.tools/cmd/stringer: use const for names, slice for map strings Improve the generated code by using a const instead of a var for the names string. This requires some refactoring to get neat const() and var() blocks. Also change the generate map code go use a single sliced string, to reduce the size of the compiled representation (only one string value).

Patch Set 1 #

Total comments: 11

Patch Set 2 : diff -r 2aa3d1c892469f5dcd093d28be98977f56b744f1 https://code.google.com/p/go.tools #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -89 lines) Patch
M cmd/stringer/golden_test.go View 1 7 chunks +57 lines, -56 lines 1 comment Download
M cmd/stringer/stringer.go View 1 7 chunks +73 lines, -33 lines 0 comments Download

Messages

Total messages: 5
r
Hello gri (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.tools
10 years, 7 months ago (2014-09-04 22:24:03 UTC) #1
gri
LGTM https://codereview.appspot.com/135450044/diff/1/cmd/stringer/golden_test.go File cmd/stringer/golden_test.go (right): https://codereview.appspot.com/135450044/diff/1/cmd/stringer/golden_test.go#newcode235 cmd/stringer/golden_test.go:235: 2: _Prime_map[0:2], _Prime_names ? https://codereview.appspot.com/135450044/diff/1/cmd/stringer/stringer.go File cmd/stringer/stringer.go (right): ...
10 years, 7 months ago (2014-09-04 22:49:18 UTC) #2
r
https://codereview.appspot.com/135450044/diff/1/cmd/stringer/stringer.go File cmd/stringer/stringer.go (right): https://codereview.appspot.com/135450044/diff/1/cmd/stringer/stringer.go#newcode487 cmd/stringer/stringer.go:487: var indexes, names []string On 2014/09/04 22:49:18, gri wrote: ...
10 years, 7 months ago (2014-09-04 23:01:02 UTC) #3
r
*** Submitted as https://code.google.com/p/go/source/detail?r=5d786ea862b5&repo=tools *** go.tools/cmd/stringer: use const for names, slice for map strings Improve ...
10 years, 7 months ago (2014-09-04 23:06:53 UTC) #4
gri
10 years, 7 months ago (2014-09-04 23:13:22 UTC) #5
Message was sent while issue was closed.
FYI

https://codereview.appspot.com/135450044/diff/20001/cmd/stringer/golden_test.go
File cmd/stringer/golden_test.go (right):

https://codereview.appspot.com/135450044/diff/20001/cmd/stringer/golden_test....
cmd/stringer/golden_test.go:235: 2:  _Prime_map[0:2],
_Prime_name_ (?)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b