Make structs public to demonstrate add tags
This commit is contained in:
@@ -2,22 +2,23 @@ package hello
|
|||||||
|
|
||||||
import ()
|
import ()
|
||||||
|
|
||||||
|
// User user type
|
||||||
type user struct {
|
type User struct {
|
||||||
ID int64
|
ID int64
|
||||||
Name string
|
Name string
|
||||||
Addr *address
|
Addr *Address
|
||||||
}
|
}
|
||||||
|
|
||||||
type address struct {
|
// Address address type
|
||||||
|
type Address struct {
|
||||||
City string
|
City string
|
||||||
ZIP int
|
ZIP int
|
||||||
LatLng [2]float64
|
LatLng [2]float64
|
||||||
}
|
}
|
||||||
|
|
||||||
var alex = user{}
|
var alex = User{}
|
||||||
|
|
||||||
// Hello writes a welcome string
|
// Hello writes a welcome string
|
||||||
func Hello() string {
|
func Hello() string {
|
||||||
return "Hello, "+alex.Name
|
return "Hello, " + alex.Name
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user