mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-11 22:06:51 +08:00
31 lines
272 B
Go
31 lines
272 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
const c = "C"
|
|
|
|
var v int = 5
|
|
|
|
type T struct{}
|
|
|
|
func init() {
|
|
// initialization of package
|
|
}
|
|
|
|
func main() {
|
|
var a int
|
|
Func1()
|
|
// ...
|
|
fmt.Println(a)
|
|
}
|
|
|
|
func (t T) Method1() {
|
|
//...
|
|
}
|
|
|
|
func Func1() { // exported function Func1
|
|
//...
|
|
}
|