Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/fix: simplify composite literals during fix #4505

Closed
rsc opened this issue Dec 7, 2012 · 5 comments
Closed

cmd/fix: simplify composite literals during fix #4505

rsc opened this issue Dec 7, 2012 · 5 comments
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Dec 7, 2012

We have a netipv6zonefix and soon a go/printer fix that turn, say,
TCPAddr{ip, port} into TCPAddr{IP: ip, Port: port}.

Those fixes should probably look for zeros in the arguments and drop them entirely, so
that:

TCPAddr{ip, 0}

can be

TCPAddr{IP: ip}

without a redundant Port: 0.
@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 1:

Labels changed: added size-m.

@gopherbot
Copy link

Comment 2 by tylerbunnell:

Should
TCPAddr{IP: ip, Port: 0}
become
TCPAddr{IP: ip}
?

@rsc
Copy link
Contributor Author

rsc commented Mar 5, 2013

Comment 3:

Probably not. If someone took the time to write the Key:Value it could be
there for emphasis or regularity.
Russ

@gopherbot
Copy link

Comment 4 by tylerbunnell:

I thought that as well, so I proceeded with the fix:
https://golang.org/cl/7468043

@mikioh
Copy link
Contributor

mikioh commented Mar 7, 2013

Comment 5:

This issue was closed by revision ae7aa34.

Status changed to Fixed.

@rsc rsc added fixed labels Mar 7, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants