| 1 |
package main |
| 2 |
|
| 3 |
import ( |
| 4 |
"fmt" |
| 5 |
"os" |
| 6 |
) |
| 7 |
|
| 8 |
const ( |
| 9 |
Sunday = iota |
| 10 |
numberOfDays // this constant is not exported |
| 11 |
) |
| 12 |
|
| 13 |
type Foo interface { |
| 14 |
FooFunc(int, float32) (complex128, []int) |
| 15 |
} |
| 16 |
|
| 17 |
type Bar struct { |
| 18 |
os.File /* multi-line |
| 19 |
comment */ |
| 20 |
PublicData chan int |
| 21 |
} |
| 22 |
|
| 23 |
func main() { |
| 24 |
ch := make(chan int) |
| 25 |
ch <- 1 |
| 26 |
x, ok := <- ch |
| 27 |
ok = true |
| 28 |
float_var := 1.0e10 |
| 29 |
defer fmt.Println('\'') |
| 30 |
defer fmt.Println(`exitting now\`) |
| 31 |
var fv1 float64 = 0.75 |
| 32 |
go println(len("hello world!")) |
| 33 |
return |
| 34 |
} |