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

Issue 7205047: code review 7205047: fmt: improve go syntax handling of byte-derived arrays ... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by kortschak
Modified:
11 years ago
Reviewers:
CC:
golang-dev, adg, remyoudompheng, rsc
Visibility:
Public.

Description

fmt: improve go syntax handling of byte-derived arrays and slices Fixes issue 4685.

Patch Set 1 #

Patch Set 2 : diff -r 45a405b5c63a https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 45a405b5c63a https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r f50a112bfe3b https://go.googlecode.com/hg/ #

Total comments: 3

Patch Set 5 : diff -r 9bcb8f09b9dc https://go.googlecode.com/hg/ #

Patch Set 6 : diff -r b90cad8349e0 https://go.googlecode.com/hg/ #

Total comments: 2

Patch Set 7 : diff -r 2e87730b5d41 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 8 : diff -r 2e87730b5d41 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -15 lines) Patch
M src/pkg/fmt/fmt_test.go View 1 2 3 4 5 6 4 chunks +12 lines, -0 lines 0 comments Download
M src/pkg/fmt/print.go View 1 2 3 4 5 6 7 3 chunks +23 lines, -15 lines 0 comments Download

Messages

Total messages: 20
kortschak
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 2 months ago (2013-01-24 01:03:03 UTC) #1
kevlar
FYI https://codereview.appspot.com/7205047/diff/3/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/7205047/diff/3/src/pkg/fmt/print.go#newcode942 src/pkg/fmt/print.go:942: if f.Type().Elem() == reflect.TypeOf(byte(0)) { I think you ...
11 years, 2 months ago (2013-01-25 09:08:35 UTC) #2
kortschak
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-01-25 10:56:33 UTC) #3
kortschak
https://codereview.appspot.com/7205047/diff/7001/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/7205047/diff/7001/src/pkg/fmt/print.go#newcode942 src/pkg/fmt/print.go:942: if f.Type().Elem().Kind() == reflect.Uint8 && f.Type().Elem().PkgPath() == "" { ...
11 years, 2 months ago (2013-01-25 11:07:36 UTC) #4
adg
https://codereview.appspot.com/7205047/diff/7001/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/7205047/diff/7001/src/pkg/fmt/print.go#newcode942 src/pkg/fmt/print.go:942: if f.Type().Elem().Kind() == reflect.Uint8 && f.Type().Elem().PkgPath() == "" { ...
11 years, 2 months ago (2013-01-29 07:33:15 UTC) #5
remyoudompheng
https://codereview.appspot.com/7205047/diff/7001/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/7205047/diff/7001/src/pkg/fmt/print.go#newcode950 src/pkg/fmt/print.go:950: bytes := make([]byte, f.Len()) I wonder why this is ...
11 years, 2 months ago (2013-01-29 07:49:55 UTC) #6
kortschak
Hello golang-dev@googlegroups.com, adg@golang.org, remyoudompheng@gmail.com (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-01-29 10:53:13 UTC) #7
rsc
not lgtm This breaks %q on []myByte. fmtBytes still needs to be called. It should ...
11 years, 2 months ago (2013-01-30 17:13:26 UTC) #8
kortschak
On 2013/01/30 17:13:26, rsc wrote: > not lgtm > > This breaks %q on []myByte. ...
11 years, 2 months ago (2013-01-30 19:36:05 UTC) #9
rsc
I believe %q on []myByte should behave the same way it currently does, that the ...
11 years, 2 months ago (2013-01-30 19:49:20 UTC) #10
kortschak
OK. That's a pity. I'll rework this.
11 years, 2 months ago (2013-01-30 19:56:37 UTC) #11
kortschak
Hello golang-dev@googlegroups.com, adg@golang.org, remyoudompheng@gmail.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-01-30 20:05:33 UTC) #12
kortschak
https://codereview.appspot.com/7205047/diff/19001/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/7205047/diff/19001/src/pkg/fmt/print.go#newcode942 src/pkg/fmt/print.go:942: if e := f.Type().Elem(); e.Kind() == reflect.Uint8 && (e.PkgPath() ...
11 years, 2 months ago (2013-01-30 20:07:39 UTC) #13
kortschak
This breaks still %s, %xand %X. I will pass type to fmtBytes.
11 years, 2 months ago (2013-01-30 20:28:55 UTC) #14
rsc
Please pass a new reflect.Type argument to fmtBytes. That should be enough. https://codereview.appspot.com/7205047/diff/19001/src/pkg/fmt/print.go File src/pkg/fmt/print.go ...
11 years, 2 months ago (2013-01-30 20:32:33 UTC) #15
kortschak
Hello golang-dev@googlegroups.com, adg@golang.org, remyoudompheng@gmail.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-01-30 22:00:12 UTC) #16
kortschak
https://codereview.appspot.com/7205047/diff/18002/src/pkg/fmt/print.go File src/pkg/fmt/print.go (right): https://codereview.appspot.com/7205047/diff/18002/src/pkg/fmt/print.go#newcode556 src/pkg/fmt/print.go:556: p.buf.WriteByte('{') Sorry. Too early.
11 years, 2 months ago (2013-01-30 22:01:16 UTC) #17
kortschak
Hello golang-dev@googlegroups.com, adg@golang.org, remyoudompheng@gmail.com, rsc@golang.org (cc: golang-dev@googlegroups.com), Please take another look.
11 years, 2 months ago (2013-01-30 22:05:41 UTC) #18
rsc
LGTM
11 years, 2 months ago (2013-01-31 01:51:14 UTC) #19
rsc
11 years, 2 months ago (2013-01-31 01:53:56 UTC) #20
*** Submitted as https://code.google.com/p/go/source/detail?r=1af88804d685 ***

fmt: improve go syntax handling of byte-derived arrays and slices

Fixes issue 4685.

R=golang-dev, adg, remyoudompheng, rsc
CC=golang-dev
https://codereview.appspot.com/7205047

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

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