Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maps #21

Open
tredoe opened this issue Jan 30, 2012 · 0 comments
Open

maps #21

tredoe opened this issue Jan 30, 2012 · 0 comments

Comments

@tredoe
Copy link

tredoe commented Jan 30, 2012

http://go-book.appspot.com/maps.html#how-to-declare-a-map

  • In the example, in line 9, numbers[3] should be numbers["trois"]

  • It isn't necessary to declare and then create a make a map

    var numbers map[string] int //declare a map of strings to ints
    numbers = make(map[string]int)

Instead:

var numbers = make(map[string]int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant