SHARE
TWEET

Untitled

a guest Apr 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package main
  2.  
  3. import "fmt"
  4. //fonksiyon adını main olarak kullanmamız bir kural mı?
  5. func main(){
  6.     //var numbers map[string] int
  7.     //fmt.Println("%d\n boş map 1",numbers)
  8.     numbers := make(map[string]int)
  9.     //fmt.Println("%d\n boş map 2",anotherNumbers)
  10.     numbers["one"] = 1
  11.     fmt.Println(numbers["one"])
  12.     numbers["two"] = 2
  13.     fmt.Println(numbers["two"])
  14.     numbers["hundred"] = 100
  15.     fmt.Println(numbers["hundred"])
  16.     fmt.Println(numbers.len())
  17.     //A satırı = var numbers map[string] int
  18.     //B satırı = numbers := make(map[string]int)
  19.     //Yukarıdaki iki satır arasındaki fark nedir?
  20.     //Neden run edince "panic: assignment to entry in nil map" hatasını veriyor?
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top