SlideShare a Scribd company logo
10/29/13

고 언어 소개

고 언어 소개
26 October 2013

이호민
GDG Korea Golang

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

1/16
10/29/13

고 언어 소개

golang

고(Go)는 간단하고, 믿을만하며, 효울적인 소프트웨어를 쉽게 만들수 있는
오픈소스 프로그래밍 환경 입니다.

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

2/16
10/29/13

고 언어 소개

Gopher

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

3/16
10/29/13

고 언어 소개

Hello world
pcaemi
akg an
ipr (
mot
"m"
ft
)
fn mi( {
uc an)
ftPitn"el Wrd"
m.rnl(Hlo ol!)
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

Run

4/16
10/29/13

고 언어 소개

Go tools
go doc fmt
go fmt
go build

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

5/16
10/29/13

고 언어 소개

왼쪽에서 오른쪽으로 읽어요
vrx yit
a ,
n

변수 x, y 는 int 타입.
fn Sma bit it{
uc u(,
n) n
rtr a+b
eun
}

함수 Sum은 인자로 a, b를 int 타입으로 받고, int 타입을 반환함.

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

6/16
10/29/13

고 언어 소개

고퍼 스타일(:=)로 선언하기
vriit
a
n

함수 안에서 선언할 때는 := 를 사용해 코드량을 줄일 수 있습니다.
i: 0
=

아래에서 변수, friends의 타입은 []string 입니다.
fins: [srn{
red = ]tig
"
뽀로로" "
, 크롱" "
, 에디" "
, 포비" "
, 해리" "
, 패티" "
, 루피"
,
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

7/16
10/29/13

고 언어 소개

조건문과 반복문
C 언어와 비슷하지만 괄호가 없으며 같은 줄에서 { 블럭이 시작됩니다
i i%2= 0{
f
=
ftPitn"vn)
m.rnl(Ee"
}

반복문은 for 만 쓰입니다.
fri: 1 i< 10 i+{
o
= ;
= 0; +
sm+ i
u =
}

다음과 같이 while 문 처럼 사용할 수도 있습니다.
sat=tm.o(
tr
ieNw)
frtm.ic(tr)<tm.eod{
o ieSnesat
ieScn
/ D smhn wie1sc
/ o otig hl
e.
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

8/16
10/29/13

고 언어 소개

안녕 친구들
pcaemi
akg an
ipr (
mot
"m"
ft
)
fn mi( {
uc an)
fins: [srn{
red = ]tig
"
뽀로로" "
, 크롱" "
, 에디" "
, 포비" "
, 해리" "
, 패티" "
, 루피"
,
}
fr_ f: rnefins{
o ,
= ag red
ftPitn"
m . r n l ( 안녕" f
, )
}
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

Run

9/16
10/29/13

고 언어 소개

동시성

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

10/16
10/29/13

고 언어 소개

goroutine
pcaemi
akg an
ipr (
mot
"m"
ft
"ie
tm"
)
fn mi( {
uc an)
g sy"e' g!,3tm.eod
o a(lts o" *ieScn)
g sy"o" 2tm.eod
o a(h!, *ieScn)
g sy"e!,1tm.eod
o a(hy" *ieScn)
tm.le( *tm.eod
ieSep4
ieScn)
}
fn sytx srn,dlytm.uain {
uc a(et tig ea ieDrto)
tm.le(ea)
ieSepdly
ftPitntx)
m.rnl(et
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

Run

11/16
10/29/13

고 언어 소개

고루틴과 채널 1/2
pcaemi
akg an
ipr (
mot
"m"
ft
"ie
tm"
)
fn ptyGetn(orca srn){
uc etsreigdo hn tig
fr{
o
ftPitn"
m . r n l ( 패티 : 안녕" < d o )
, -or
tm.le(0 *tm.ilscn)
ieSep30
ieMlieod
}
}
fn mi( {
uc an)
do : mk(hnsrn)
or = aeca tig
g ptyGetn(or
o etsreigdo)
f i n s : [ s r n { 뽀로로" "
red = ]tig"
, 크롱" "
, 에디" "
, 포비" "
, 해리" "
, 루피"
}
fr_ g: rnefins{
o ,
= ag red
do < g
or }
tm.le(ieScn)
ieSeptm.eod
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

Run

12/16
10/29/13

고 언어 소개

고루틴과 채널 2/2
pcaemi
akg an
ipr (
mot
"m"
ft
"ie
tm"
)
fn getn(orca srn,hs srn,m it {
uc reigdo hn tig ot tig s n)
fr{
o
f t P i t n h s , " 안녕" < d o )
m.rnl(ot :
, -or
tm.le(ieDrto(s *tm.ilscn)
ieSeptm.uainm)
ieMlieod
}
}
fn mi( {
uc an)
do : mk(hnsrn)
or = aeca tig
g getn(or "
o r e i g d o , 패티" 3 0
, 0)
g getn(or "
o r e i g d o , 에디" 1 0
, 5)
f i n s : [ s r n { 뽀로로" "
red = ]tig"
, 크롱" "
, 포비" "
, 해리" "
, 루피"
}
fr_ g: rnefins{
o ,
= ag red
do < g
or }
tm.le(ieScn)
ieSeptm.eod
}

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

Run

13/16
10/29/13

고 언어 소개

고 언어 사용자 그룹
GDG Korea Golang(https://plus.google.com/communities/115721275599816202991)

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

14/16
10/29/13

고 언어 소개

참고
Go tour (한국어) (http://go-tour-kr.appspot.com/)
Go's Declaration Syntax (http://golang.org/doc/articles/gos_declaration_syntax.html)
Effecgive Go (http://golang.org/doc/effective_go.html)

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

15/16
10/29/13

고 언어 소개

Thank you
이호민
GDG Korea Golang
@suapapa (http://twitter.com/suapapa)

127.0.0.1:3999/slide/go_intro/go_intro.slide#16

16/16

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 

Featured (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

고 언어 소개

  • 1. 10/29/13 고 언어 소개 고 언어 소개 26 October 2013 이호민 GDG Korea Golang 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 1/16
  • 2. 10/29/13 고 언어 소개 golang 고(Go)는 간단하고, 믿을만하며, 효울적인 소프트웨어를 쉽게 만들수 있는 오픈소스 프로그래밍 환경 입니다. 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 2/16
  • 4. 10/29/13 고 언어 소개 Hello world pcaemi akg an ipr ( mot "m" ft ) fn mi( { uc an) ftPitn"el Wrd" m.rnl(Hlo ol!) } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 Run 4/16
  • 5. 10/29/13 고 언어 소개 Go tools go doc fmt go fmt go build 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 5/16
  • 6. 10/29/13 고 언어 소개 왼쪽에서 오른쪽으로 읽어요 vrx yit a , n 변수 x, y 는 int 타입. fn Sma bit it{ uc u(, n) n rtr a+b eun } 함수 Sum은 인자로 a, b를 int 타입으로 받고, int 타입을 반환함. 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 6/16
  • 7. 10/29/13 고 언어 소개 고퍼 스타일(:=)로 선언하기 vriit a n 함수 안에서 선언할 때는 := 를 사용해 코드량을 줄일 수 있습니다. i: 0 = 아래에서 변수, friends의 타입은 []string 입니다. fins: [srn{ red = ]tig " 뽀로로" " , 크롱" " , 에디" " , 포비" " , 해리" " , 패티" " , 루피" , } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 7/16
  • 8. 10/29/13 고 언어 소개 조건문과 반복문 C 언어와 비슷하지만 괄호가 없으며 같은 줄에서 { 블럭이 시작됩니다 i i%2= 0{ f = ftPitn"vn) m.rnl(Ee" } 반복문은 for 만 쓰입니다. fri: 1 i< 10 i+{ o = ; = 0; + sm+ i u = } 다음과 같이 while 문 처럼 사용할 수도 있습니다. sat=tm.o( tr ieNw) frtm.ic(tr)<tm.eod{ o ieSnesat ieScn / D smhn wie1sc / o otig hl e. } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 8/16
  • 9. 10/29/13 고 언어 소개 안녕 친구들 pcaemi akg an ipr ( mot "m" ft ) fn mi( { uc an) fins: [srn{ red = ]tig " 뽀로로" " , 크롱" " , 에디" " , 포비" " , 해리" " , 패티" " , 루피" , } fr_ f: rnefins{ o , = ag red ftPitn" m . r n l ( 안녕" f , ) } } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 Run 9/16
  • 11. 10/29/13 고 언어 소개 goroutine pcaemi akg an ipr ( mot "m" ft "ie tm" ) fn mi( { uc an) g sy"e' g!,3tm.eod o a(lts o" *ieScn) g sy"o" 2tm.eod o a(h!, *ieScn) g sy"e!,1tm.eod o a(hy" *ieScn) tm.le( *tm.eod ieSep4 ieScn) } fn sytx srn,dlytm.uain { uc a(et tig ea ieDrto) tm.le(ea) ieSepdly ftPitntx) m.rnl(et } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 Run 11/16
  • 12. 10/29/13 고 언어 소개 고루틴과 채널 1/2 pcaemi akg an ipr ( mot "m" ft "ie tm" ) fn ptyGetn(orca srn){ uc etsreigdo hn tig fr{ o ftPitn" m . r n l ( 패티 : 안녕" < d o ) , -or tm.le(0 *tm.ilscn) ieSep30 ieMlieod } } fn mi( { uc an) do : mk(hnsrn) or = aeca tig g ptyGetn(or o etsreigdo) f i n s : [ s r n { 뽀로로" " red = ]tig" , 크롱" " , 에디" " , 포비" " , 해리" " , 루피" } fr_ g: rnefins{ o , = ag red do < g or } tm.le(ieScn) ieSeptm.eod } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 Run 12/16
  • 13. 10/29/13 고 언어 소개 고루틴과 채널 2/2 pcaemi akg an ipr ( mot "m" ft "ie tm" ) fn getn(orca srn,hs srn,m it { uc reigdo hn tig ot tig s n) fr{ o f t P i t n h s , " 안녕" < d o ) m.rnl(ot : , -or tm.le(ieDrto(s *tm.ilscn) ieSeptm.uainm) ieMlieod } } fn mi( { uc an) do : mk(hnsrn) or = aeca tig g getn(or " o r e i g d o , 패티" 3 0 , 0) g getn(or " o r e i g d o , 에디" 1 0 , 5) f i n s : [ s r n { 뽀로로" " red = ]tig" , 크롱" " , 포비" " , 해리" " , 루피" } fr_ g: rnefins{ o , = ag red do < g or } tm.le(ieScn) ieSeptm.eod } 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 Run 13/16
  • 14. 10/29/13 고 언어 소개 고 언어 사용자 그룹 GDG Korea Golang(https://plus.google.com/communities/115721275599816202991) 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 14/16
  • 15. 10/29/13 고 언어 소개 참고 Go tour (한국어) (http://go-tour-kr.appspot.com/) Go's Declaration Syntax (http://golang.org/doc/articles/gos_declaration_syntax.html) Effecgive Go (http://golang.org/doc/effective_go.html) 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 15/16
  • 16. 10/29/13 고 언어 소개 Thank you 이호민 GDG Korea Golang @suapapa (http://twitter.com/suapapa) 127.0.0.1:3999/slide/go_intro/go_intro.slide#16 16/16