Development/Go

Go 기초

juniz 2020. 8. 23. 03:01
반응형

Characteristic

  1. Simple
  2. Fast compiling speed, Cross-compiling
  3. Concurrency
    1. Goroutine - Execution
    2. Chanel - Communication
    3. Select - Coordination
  4. Error Handling
val, er := Get()
if err =! nil {
	//error handling
}

 

Go keywords

break default func interface select

case defer go map struct

chan else goto package switch

const fallthrough if range type

continue for import return var

 

 

Install Go [link]

Init mode `go mod init <name>`

 

Hello World

Terminal : `mkdir helloworld`

package main

import "fmt"

func main() {
	fmt.Println("Hello, World")
}

To rn : `go run helloworld`

 

반응형