One year of Go

bearophile bearophileHUGS at lycos.com
Fri Nov 12 10:33:03 PST 2010


Steven Schveighoffer:

> If that is invalid code, then I stand corrected.  If it compiles, then  
> it's a serious flaw that is inexcusable.

You need more time to try it on the site that Walter thinks is useless:
http://ideone.com/Ju80U

This Go code:

package main
 
import "fmt"
 
func main() {
  x := 5
  if(x == 6)
  {
    x++;
  }
  fmt.Printf("%d\n", x)
}


Produces this compilation error (gc-2010-07-14):
prog.go:7: x == 6 not used

The interactive compiler on the Go site produces the same outcome:
http://golang.org/

Bye,
bearophile


More information about the Digitalmars-d mailing list