mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:55:35 +08:00
fix: coding style and file format for all example.
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"./person"
|
||||
)
|
||||
|
||||
func main() {
|
||||
p := new(person.Person)
|
||||
// error: p.firstName undefined (cannot refer to unexported field or method firstName)
|
||||
// p.firstName = "Eric"
|
||||
p.SetFirstName("Eric")
|
||||
fmt.Println(p.FirstName()) // Output: Eric
|
||||
}
|
||||
package main
|
||||
|
||||
import (
|
||||
"./person"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func main() {
|
||||
p := new(person.Person)
|
||||
// error: p.firstName undefined (cannot refer to unexported field or method firstName)
|
||||
// p.firstName = "Eric"
|
||||
p.SetFirstName("Eric")
|
||||
fmt.Println(p.FirstName()) // Output: Eric
|
||||
}
|
||||
|
Reference in New Issue
Block a user