Skip to content

Commit

Permalink
hello
Browse files Browse the repository at this point in the history
  • Loading branch information
GoesToEleven committed Nov 4, 2015
1 parent b4e89df commit a4614a2
Show file tree
Hide file tree
Showing 29 changed files with 30 additions and 7 deletions.
18 changes: 18 additions & 0 deletions 19_map/01_var_nil-map/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package main

import "fmt"

func main() {

var myGreeting map[string]string
fmt.Println(myGreeting)
fmt.Println(myGreeting == nil)
}

// add these lines:
/*
myGreeting["Tim"] = "Good morning."
myGreeting["Jenny"] = "Bonjour."
*/
// and you will get this:
// panic: assignment to entry in nil map
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions 19_map/04_shorthand_composite-literal/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

import "fmt"

func main() {

myGreeting := map[string]string{}
myGreeting["Tim"] = "Good morning."
myGreeting["Jenny"] = "Bonjour."

fmt.Println(myGreeting)
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions check.txt

This file was deleted.

3 changes: 0 additions & 3 deletions new.txt

This file was deleted.

0 comments on commit a4614a2

Please sign in to comment.