Skip to content

Commit

Permalink
load to map function
Browse files Browse the repository at this point in the history
  • Loading branch information
gagarinfan committed Dec 13, 2018
1 parent 5007ffd commit be3b8ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/people.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,13 @@ func describe(p People) {
fmt.Println("Hi", p.GetName())
}

func loadToMap(m map[string]Person, p Person) {
m[p.id] = p
fmt.Println(m)
}
func main() {
//var map = make(map[string]Person)

m := make(map[string]Person)
fmt.Println("Insert your data here:")
var name, surname, hobby string
var age int
Expand All @@ -44,5 +48,5 @@ func main() {

newMan := createUser(name, surname, hobby, id, age, active)
describe(newMan)

loadToMap(m, *newMan)
}

0 comments on commit be3b8ad

Please sign in to comment.