SlideShare a Scribd company logo
1 of 41
@golanger Jongmin Kim The Go Programming Language
Overview ,[object Object],[object Object],[object Object],[object Object],[object Object]
Go history ,[object Object],[object Object],[object Object],[object Object]
Why a New Language? ,[object Object],[object Object],[object Object],[object Object]
To put it in a positive way ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
package main import "fmt" func main() {         fmt.Println("Hello,  안녕 ") } hello.go
Compiler ,[object Object],[object Object]
Variables declaration ,[object Object],[object Object],[object Object],[object Object],i  :=  15 s  :=  "foo" i, s  :=  15, "foo" var (         i int         s string )
Functions    1/3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Functions    2/3 ,[object Object],[object Object],[object Object],[object Object],[object Object]
Functions    3/3 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
if ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
for ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],list := []string{"a", "b", "c"} for k, v :=  range  list { }
switch ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],switch i { case 0: case 1:         f()        // f is not called    when i == 0 } switch i { case 0:   fallthrough case 1:         f()        // f is called    when i == 0 }
Types ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],complex64 complex128 byte bool uint int uintptr string array slice map pointer  // no pointer arithmetic const struct interface channel
Conversions    1/2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Conversions    2/2 ,[object Object],[object Object],[object Object],[object Object]
const ,[object Object],const (        FATAL =  iota        ERROR         WARN         INFO         DEBUG         TRACE ) const a = 1 const (         a = 1         b = "go" )
Arrays ,[object Object],[object Object],[object Object],[object Object],arr := [3]int{1, 2, 3} arr := [ ... ]int{1, 2, 3} ar := [2][3]int {  [3]int{1, 2, 3}, [3]int{1, 2, 3}  } ar := [2][3]int {  [ ... ]int{1, 2, 3}, [ ... ]int{1, 2, 3}  }
Slices      1/2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Slices      2/2 ,[object Object],[object Object],[object Object]
Maps ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Structs ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
new()  vs  make() ,[object Object],[object Object]
Methods ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
interfaces ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
delegation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
defer    1/2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],func ReadWrite() bool {        file.Open("file")         defer  file.Close()        // do somthing...        if failureX {                return false        }        if failureY {              return false        }        return true }
defer    2/2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
goroutine    1/2 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
goroutine    2/2 ,[object Object],[object Object],[object Object],[object Object],[object Object]
channel ,[object Object],[object Object],[object Object],[object Object]
channel ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
You.rl with MongoDB (Simple URL shortener example)
Requirements ,[object Object],[object Object],[object Object]
View source https://github.com/golang-korea/You.RL
You.rl demo
tools ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Packages ,[object Object]
Go project dashboard ,[object Object]
Try Go today! http://golang.org

More Related Content

What's hot

Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
mua99
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
akaptur
 

What's hot (20)

GeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheetGeoGebra JavaScript CheatSheet
GeoGebra JavaScript CheatSheet
 
C++ L03-Control Structure
C++ L03-Control StructureC++ L03-Control Structure
C++ L03-Control Structure
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 
Introduction to go
Introduction to goIntroduction to go
Introduction to go
 
Free Monads Getting Started
Free Monads Getting StartedFree Monads Getting Started
Free Monads Getting Started
 
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
[FT-11][suhorng] “Poor Man's” Undergraduate Compilers
 
array, function, pointer, pattern matching
array, function, pointer, pattern matchingarray, function, pointer, pattern matching
array, function, pointer, pattern matching
 
Infix to-postfix examples
Infix to-postfix examplesInfix to-postfix examples
Infix to-postfix examples
 
F# intro
F# introF# intro
F# intro
 
Are we ready to Go?
Are we ready to Go?Are we ready to Go?
Are we ready to Go?
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For Google
 
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPythonByterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
Byterun, a Python bytecode interpreter - Allison Kaptur at NYCPython
 
When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)
 
week-16x
week-16xweek-16x
week-16x
 
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!..."A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
"A 1,500 line (!!) switch statement powers your Python!" - Allison Kaptur, !!...
 
C++ L04-Array+String
C++ L04-Array+StringC++ L04-Array+String
C++ L04-Array+String
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Semaphore
SemaphoreSemaphore
Semaphore
 
Unit 3
Unit 3 Unit 3
Unit 3
 
Diving into byte code optimization in python
Diving into byte code optimization in python Diving into byte code optimization in python
Diving into byte code optimization in python
 

Similar to About Go

Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象
勇浩 赖
 
C++ Advanced
C++ AdvancedC++ Advanced
C++ Advanced
Vivek Das
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
Jussi Pohjolainen
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overview
stn_tkiller
 

Similar to About Go (20)

Falcon初印象
Falcon初印象Falcon初印象
Falcon初印象
 
C++ Advanced
C++ AdvancedC++ Advanced
C++ Advanced
 
WebSummit 2015 - Gopher it
WebSummit 2015 - Gopher itWebSummit 2015 - Gopher it
WebSummit 2015 - Gopher it
 
Go Says WAT?
Go Says WAT?Go Says WAT?
Go Says WAT?
 
Something about Golang
Something about GolangSomething about Golang
Something about Golang
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
Go Lang Tutorial
Go Lang TutorialGo Lang Tutorial
Go Lang Tutorial
 
为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?为什么 rust-lang 吸引我?
为什么 rust-lang 吸引我?
 
Golang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / OverviewGolang and Eco-System Introduction / Overview
Golang and Eco-System Introduction / Overview
 
Scala 2 + 2 > 4
Scala 2 + 2 > 4Scala 2 + 2 > 4
Scala 2 + 2 > 4
 
Rust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command LineRust LDN 24 7 19 Oxidising the Command Line
Rust LDN 24 7 19 Oxidising the Command Line
 
C programming
C programmingC programming
C programming
 
4 operators, expressions & statements
4  operators, expressions & statements4  operators, expressions & statements
4 operators, expressions & statements
 
Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#Tuga IT 2018 Summer Edition - The Future of C#
Tuga IT 2018 Summer Edition - The Future of C#
 
Let's golang
Let's golangLet's golang
Let's golang
 
pointers 1
pointers 1pointers 1
pointers 1
 
Antlr V3
Antlr V3Antlr V3
Antlr V3
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
 
Gift-VT Tools Development Overview
Gift-VT Tools Development OverviewGift-VT Tools Development Overview
Gift-VT Tools Development Overview
 
C to perl binding
C to perl bindingC to perl binding
C to perl binding
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

About Go

Editor's Notes

  1. * 의존성관리 C 와 같은 헤더 파일들은 의존성 분석과 빠른 컴파일을 하는 것과는 상반된 형태를 가지고 있다 . * 인기있는 시스템 언어들은 GC 와 병렬 계산에 대한 지원이 부족하다 .
  2. 세미콜론이 필요없다는 얘기 
  3. 64 가장 좋고 arm: 불완전하지만 Nexus One 에서 테스트되었고 The compilers can target the FreeBSD, Linux, and OS X (a.k.a. Darwin) operating systems. (A port to Microsoft Windows is in progress but incomplete. See the   Windows Port   page for details.) 쉘로 가서   gtug/hello 들어가서 8g, 8l 등 컴파일 실행파일 비교 컴파일 , Makefile 사용 go/ 소스트리 대충 설명
  4. () 는 없고 , { 는 필수
  5. () 는 없고 , { 는 필수
  6. () 는 없고 , { 는 필수
  7. iota - 극히 적은 양
  8. slice 는 size 없이 선
  9. slice 는 size 없이 선
  10. slice 는 size 없이 선
  11. slice 는 size 없이 선
  12. T type 을 위한 메모리를 할당하고 그 주소를 리턴한다 . Because we need to make a slice, not just allocate the memory. Note make([]int, 10) returns []int while new([]int) returns *[]int. slice, map, channel 같은 type 은 사용하기 전에 반드시 초기화 되어야 하는 data structure 를 레퍼런스 하고 있기 때문에 make 를 사용해야 한다 . new 를 사용하면 저렇게 된다 .
  13. duck typing 얘기 .. Go 는 클래스가 없지만 메서드를 붙일 수 있다 . 메서드는 리시버를 가진 function 이다 . built-in type 들한테 메서드를 만들 수는 없지만 type Foo int func (f *Foo) MyFunc() {     println("OK") } func main() {     var a Foo     a.MyFunc() } 이렇게 가능하다 . (f *Foo) 와 (f Foo) 의 차이가 뭐지 . 이렇게 function 이 method 가 되면 function 처럼 호출 안됨 (undefined error)
  14. * interface 는 구현하지 않은 메서드들의 집합이라는 점은 다른 언어와 같다 . * inheritance 가 아닌 delegation 을 통해 class 의 상속이 아닌 다른 클래스를 통해 기능을 확장하는 바 ---------------------------------------- package main type I interface { Get() int Put(int) } type S struct { i int } func (p *S) Get() int { return p.i } func (p *S) Put(v int) { p.i = v } func main() { var s S f(&s) } S 가 I 를 구현했는지 안했는지 run-time 시 알아내는 방법 2 가지 func f(p I) {     switch t := p.( type ) {     case *S:     case *R:     case S:     case R: .4.     default: } func f(p I) { if t, ok := p.(I) ; ok { println("ok", t, ok) } else { println("not", t, ok) } } * 왜 implements 를 사용하지 않느냐 ? duck typing. 관심사를 분리한다 . 이미 구현된 struct, method 형태 ( 클래스 형태 ) 에서 인터페이스만 나중에 뽑아낼 수도 있다 . 이렇게 하면 기존 코드를 고치지 않고 인터페이스가 정의되고 사용할 수 있게 되는 것이다 .  Go 는 type hierarchy 가 없다 io.Writer 인터페이스에는 Write() 메서드가 있는데 이걸 구현하고 있는 애들에 따라 다양한 Write 가 가능하게 되는 것이다 .
  15. defer 와 함께 panic, recover 빌트인 function 도  정리해야 할 것 http://blog.golang.org/2010/08/defer-panic-and-recover.html
  16. There are many terms for "things that run concurrently" - process, thread, coroutine, POSIX thread, NPTL thread, lightweight process, ..., but these all mean slightly different things. None means exactly how Go does concurrency. So we introduce a new term: goroutine. 다른 goroutine 들과 same address space 에서 뱅행적으로 시
  17. There are many terms for "things that run concurrently" - process, thread, coroutine, POSIX thread, NPTL thread, lightweight process, ..., but these all mean slightly different things. None means exactly how Go does concurrency. So we introduce a new term: goroutine. 다른 goroutine 들과 same address space 에서 뱅행적으로 시
  18. select 라고 <-c 두번 안해줘도 되는 방법 이
  19. 왜 try-catch-finally 가 없는지에 대한 좋은 글 http://blog.golang.org/2010/08/defer-panic-and-recover.html