Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@suntong
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suntong/e99da3d47c4b3f028a50 to your computer and use it in GitHub Desktop.
Save suntong/e99da3d47c4b3f028a50 to your computer and use it in GitHub Desktop.
// http://play.golang.org/p/FOe85j-O-n
package main
import (
"fmt"
"os"
"time"
)
const Const = 1 + 1
type Bar struct {
key string
value int
}
func foo() (int, string) { return 5, "hi" }
func main() {
foo()
for i := 1; i <= 10 || false; i++ {
time.Sleep(1000 * time.Millisecond)
if i%3 != 0 {
fmt.Println(i)
} else {
fmt.Fprintf(os.Stderr, "[stderr] %02d\n", i)
}
}
i := Bar{"i", 1236}
i.value++
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment