mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 05:11:49 +08:00
04.4.1.md
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
const c = "C"
|
||||
@@ -10,20 +10,21 @@ var v int = 5
|
||||
|
||||
type T struct{}
|
||||
|
||||
func init() { // initialization of package
|
||||
func init() {
|
||||
// initialization of package
|
||||
}
|
||||
|
||||
func main() {
|
||||
var a int
|
||||
Func1()
|
||||
// ...
|
||||
fmt.Println(a)
|
||||
var a int
|
||||
Func1()
|
||||
// ...
|
||||
fmt.Println(a)
|
||||
}
|
||||
|
||||
func (t T) Method1() {
|
||||
//...
|
||||
//...
|
||||
}
|
||||
|
||||
func Func1() { // exported function Func1
|
||||
//...
|
||||
//...
|
||||
}
|
||||
|
Reference in New Issue
Block a user