<pre class="notranslate">gc handles struct/array comparisons by short-circuiting if it finds any unequal
fields/elements, and this behavior is noticeable because the Go spec requires
comparisons to panic in some cases; e.g., see <a href="http://play.golang.org/p/5jqSUAT1xC" rel="nofollow">http://play.golang.org/p/5jqSUAT1xC</a>

However, unlike short-circuiting for evaluating "a &amp;&amp; b", it doesn't
seem that short-circuiting of field/element comparisons is specified by the spec. 
Arguably, the spec currently requires that instead both comparisons in the above program
should panic.

Not a major issue, but thought I'd file an issue to note it.  A couple possible ways to
address it:

1. Ignore it since it probably doesn't matter in practice.
2. Specify gc's behavior since it's intuitive and easy to explain.
3. Specify a set of allowable behaviors (e.g., allow short-circuiting or not; and/or
allow any particular ordering for element/field comparisons).
4. Change gc to not (visibly) short-circuit comparisons that involve comparing interface
types; e.g., comparing two [512]int arrays can still short-circuit, but comparing two
struct{a int; b, c interface{}; d int} structs would need to always compare the b and c
fields, and a and d could be compared conditionally.</pre>
<pre class="notranslate">What steps will reproduce the problem?
1. Try to gofix a file containing an old-style (r60.3) "time" reference with a
comment after it, e.g. example below or src/pkg/crypto/tls/generate_cert.go

What is the expected output?
file.go: fixed time+fileinfo

What do you see instead?
file.go:9:36: expected ')', found newline
file.go:10:4: expected statement, found ')'

Which compiler are you using (5g, 6g, 8g, gccgo)? 6g

Which operating system are you using? Ubuntu 11.10

Which revision are you using? weekly.2011-12-22

Please provide any additional information below.

Example:

---

package main

import (
    "fmt"
    "time"
)

func main() {
    fmt.Println(time.SecondsToUTC(now)) // this won't work
}

---

With the comment:

# gofix fix.go 
fix.go:9:36: expected ')', found newline
fix.go:10:4: expected statement, found ')'

Without:

# gofix fix.go 
fix.go: fixed time+fileinfo</pre>