FAQ
Reviewers: golang-dev1,

Message:
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go


Description:
gofmt: explain why lower bounds aren't automatically simplified

Full credit goes to gri and rsc for their explanations.

Please review this at https://codereview.appspot.com/14229043/

Affected files (+6, -0 lines):
    M src/cmd/gofmt/simplify.go


Index: src/cmd/gofmt/simplify.go
===================================================================
--- a/src/cmd/gofmt/simplify.go
+++ b/src/cmd/gofmt/simplify.go
@@ -91,6 +91,12 @@
     // but we leave them as is since sometimes we want to be very
explicit
     // about the lower bound.

+ // An example where the 0 helps:
+ // x, y, z := b[0:2], b[2:4], b[4:6]
+
+ // An example where it does not:
+ // x, y := b[:n], b[n:]
+
    case *ast.RangeStmt:
     // a range of the form: for x, _ = range v {...}
     // can be simplified to: for x = range v {...}


--

---
You received this message because you are subscribed to the Google Groups "golang-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 1, '13 at 7:28p
activeOct 1, '13 at 9:45p
posts2
users2
websitegolang.org

2 users in discussion

R: 1 post Robert Hencke: 1 post

People

Translate

site design / logo © 2022 Grokbase