@golanger Jongmin Kim The Go Programming Language
Overview <ul><ul><li>Introduction </li></ul></ul><ul><ul><li>Syntax </li></ul></ul><ul><ul><li>Features </li></ul></ul><ul...
Go history <ul><ul><li>2007-09: Google's 20% project </li></ul></ul><ul><ul><li>2008-05: full-time project </li></ul></ul>...
Why a New Language? <ul><ul><li>Computers are enormously quicker but software development is not faster. </li></ul></ul><u...
To put it in a positive way <ul><ul><li>Go team's goal is to make programming fun again. </li></ul></ul><ul><ul><li>the fe...
package main import &quot;fmt&quot; func main() {         fmt.Println(&quot;Hello,  안녕 &quot;) } hello.go
Compiler <ul><ul><li>gc x86-64:  6g,   6l x86-32:  8g, 8l arm:  5g, 5l   (incomplete) </li></ul></ul><ul><ul><li>gccgo -  ...
Variables declaration <ul><li>var    i int </li></ul><ul><li>var s string </li></ul><ul><li>i = 15 </li></ul><ul><li>s = &...
Functions    1/3 <ul><li>func f() { </li></ul><ul><li>} </li></ul><ul><li>func f(i int) { </li></ul><ul><li>} </li></ul><u...
Functions    2/3 <ul><li>// Multiple return values </li></ul><ul><li>func Open(path string) ( file *File, err Error ) { </...
Functions    3/3 <ul><li>func main() { </li></ul><ul><li>        f :=  func (s string) { </li></ul><ul><li>               ...
if <ul><li>if x > 0 { </li></ul><ul><li>        return y </li></ul><ul><li>} else { </li></ul><ul><li>        return x </l...
for <ul><li>for { </li></ul><ul><li>} </li></ul><ul><li>for err != nil { </li></ul><ul><li>} </li></ul><ul><li>for i := 0;...
switch <ul><li>switch { </li></ul><ul><li>case a > b: </li></ul><ul><li>        return true </li></ul><ul><li>case a < b: ...
Types <ul><li>uint8 </li></ul><ul><li>uint16 </li></ul><ul><li>uint32 </li></ul><ul><li>uint64 </li></ul><ul><li>int8 </li...
Conversions    1/2 <ul><li>var f float32 </li></ul><ul><li>var i  uint32 </li></ul><ul><li>f = 3.14159 </li></ul><ul><li>i...
Conversions    2/2 <ul><li>mystring := &quot;Hello, Go&quot; </li></ul><ul><li>byteslice :=  []byte (mystring) </li></ul><...
const <ul><li>Constants can only be numbers, strings or booleans. </li></ul>const (        FATAL =  iota        ERROR     ...
Arrays <ul><li>var arr [3]int </li></ul><ul><li>arr[0] = 1 </li></ul><ul><li>arr[1] = 2 </li></ul><ul><li>arr[2] = 3 </li>...
Slices      1/2 <ul><li>A slice is a reference to a section of an array. </li></ul><ul><li>ar := [3]int{1, 2, 3} </li></ul...
Slices      2/2 <ul><li>ar[ :n ]    ==    ar[0:n] </li></ul><ul><li>ar[ n: ]    ==    ar[n:len(ar)] </li></ul><ul><li>ar[ ...
Maps <ul><li>var m  map[string]int </li></ul><ul><li>monthdays :=  map [ string ] int { </li></ul><ul><li>                ...
Structs <ul><li>type Point  struct  { </li></ul><ul><li>        x, y float64 </li></ul><ul><li>} </li></ul><ul><li>var p P...
new()  vs  make() <ul><ul><li>new  returns pointers. t := new(T) </li></ul></ul><ul><ul><li>make   returns initialized val...
Methods <ul><li>type  Point  struct { </li></ul><ul><li>        x, y int </li></ul><ul><li>} </li></ul><ul><li>func  (p *P...
interfaces <ul><li>type   Point   struct    {    x, y int    } </li></ul><ul><li>func   (p *Point)   Get () (int, int)    ...
delegation <ul><li>type MorePointer struct { </li></ul><ul><li>Point   // anonymous field </li></ul><ul><li>z int </li></u...
defer    1/2 <ul><li>func ReadWrite() bool { </li></ul><ul><li>       file.Open(&quot;file&quot;) </li></ul><ul><li>      ...
defer    2/2 <ul><li>func f() { </li></ul><ul><li>        for i := 0; i < 5; i++ { </li></ul><ul><li>                defer...
goroutine    1/2 <ul><li>func ready(w string, sec int64) { </li></ul><ul><li>       time.Sleep(sec * 1e9) </li></ul><ul><l...
goroutine    2/2 <ul><li>goroutines were running concurrent, they were not running in parallel. </li></ul><ul><li>To run i...
channel <ul><li>c := make(chan int) </li></ul><ul><li>c <- 1            // send 1 on c (flowing into c) </li></ul><ul><li>...
channel <ul><li>var c chan int </li></ul><ul><li>func ready(w string, sec int64) { </li></ul><ul><li>       time.Sleep(sec...
You.rl with MongoDB (Simple URL shortener example)
Requirements <ul><ul><li>Create shortened URL. Do not duplicate keys </li></ul></ul><ul><ul><li>Save { &quot;Shortened_URL...
View source https://github.com/golang-korea/You.RL
You.rl demo
tools <ul><li>gomake </li></ul><ul><li>goinstall </li></ul><ul><li>godoc </li></ul><ul><li>gofix </li></ul><ul><li>gofmt <...
Packages <ul><li>http://golang.org/pkg/ </li></ul>
Go project dashboard <ul><li>http://godashboard.appspot.com/project </li></ul>
Try Go today! http://golang.org
Upcoming SlideShare
Loading in...5
×

About Go

5,639

Published on

The Go programming language presentation at Seoul GTUG

Published in: Technology
2 Comments
17 Likes
Statistics
Notes
  • @Nigel Wood, Yes right, new returns zeroed values.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • On Slide 24 I don't think 'new returns pointers' hits the high point. new returns a pointer to ZEROED memory. booleans are set to false, strings to empty string, numbers to zero etc.

    Make on the other hand initializes the container/channel types
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
5,639
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
2
Likes
17
Embeds 0
No embeds

No notes for slide
  • * 의존성관리 C 와 같은 헤더 파일들은 의존성 분석과 빠른 컴파일을 하는 것과는 상반된 형태를 가지고 있다 . * 인기있는 시스템 언어들은 GC 와 병렬 계산에 대한 지원이 부족하다 .
  • 세미콜론이 필요없다는 얘기 
  • 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/ 소스트리 대충 설명
  • () 는 없고 , { 는 필수
  • () 는 없고 , { 는 필수
  • () 는 없고 , { 는 필수
  • iota - 극히 적은 양
  • slice 는 size 없이 선
  • slice 는 size 없이 선
  • slice 는 size 없이 선
  • slice 는 size 없이 선
  • 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 를 사용하면 저렇게 된다 .
  • duck typing 얘기 .. Go 는 클래스가 없지만 메서드를 붙일 수 있다 . 메서드는 리시버를 가진 function 이다 . built-in type 들한테 메서드를 만들 수는 없지만 type Foo int func (f *Foo) MyFunc() {     println(&amp;quot;OK&amp;quot;) } func main() {     var a Foo     a.MyFunc() } 이렇게 가능하다 . (f *Foo) 와 (f Foo) 의 차이가 뭐지 . 이렇게 function 이 method 가 되면 function 처럼 호출 안됨 (undefined error)
  • * 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(&amp;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(&amp;quot;ok&amp;quot;, t, ok) } else { println(&amp;quot;not&amp;quot;, t, ok) } } * 왜 implements 를 사용하지 않느냐 ? duck typing. 관심사를 분리한다 . 이미 구현된 struct, method 형태 ( 클래스 형태 ) 에서 인터페이스만 나중에 뽑아낼 수도 있다 . 이렇게 하면 기존 코드를 고치지 않고 인터페이스가 정의되고 사용할 수 있게 되는 것이다 .  Go 는 type hierarchy 가 없다 io.Writer 인터페이스에는 Write() 메서드가 있는데 이걸 구현하고 있는 애들에 따라 다양한 Write 가 가능하게 되는 것이다 .
  • defer 와 함께 panic, recover 빌트인 function 도  정리해야 할 것 http://blog.golang.org/2010/08/defer-panic-and-recover.html
  • There are many terms for &amp;quot;things that run concurrently&amp;quot; - 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 에서 뱅행적으로 시
  • There are many terms for &amp;quot;things that run concurrently&amp;quot; - 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 에서 뱅행적으로 시
  • select 라고 &lt;-c 두번 안해줘도 되는 방법 이
  • 왜 try-catch-finally 가 없는지에 대한 좋은 글 http://blog.golang.org/2010/08/defer-panic-and-recover.html
  • Transcript of "About Go"

    1. 1. @golanger Jongmin Kim The Go Programming Language
    2. 2. Overview <ul><ul><li>Introduction </li></ul></ul><ul><ul><li>Syntax </li></ul></ul><ul><ul><li>Features </li></ul></ul><ul><ul><li>URL shortener demo </li></ul></ul><ul><ul><li>Go trends </li></ul></ul>
    3. 3. Go history <ul><ul><li>2007-09: Google's 20% project </li></ul></ul><ul><ul><li>2008-05: full-time project </li></ul></ul><ul><ul><li>2009-11: officially announced </li></ul></ul><ul><ul><li>Current: r59 stable release </li></ul></ul>
    4. 4. Why a New Language? <ul><ul><li>Computers are enormously quicker but software development is not faster. </li></ul></ul><ul><ul><li>Dependency management is a big part of software development today. </li></ul></ul><ul><ul><li>Garbage collection and parallel computation   are not well supported by popular systems languages. </li></ul></ul><ul><ul><li>Multi-core seen as crisis not opportunity. </li></ul></ul>
    5. 5. To put it in a positive way <ul><ul><li>Go team's goal is to make programming fun again. </li></ul></ul><ul><ul><li>the feel of a dynamic language with the safety of   a static type system </li></ul></ul><ul><ul><li>compile to machine language so it runs fast </li></ul></ul><ul><ul><li>real run-time that supports GC, concurrency </li></ul></ul><ul><ul><li>lightweight, flexible type system </li></ul></ul><ul><ul><li>has methods but not a conventional OO language </li></ul></ul><ul><ul><li>open source project, distributed under a BSD-style license. </li></ul></ul><ul><ul><li>Google App Engine gets support for Go. </li></ul></ul>
    6. 6. package main import &quot;fmt&quot; func main() {     fmt.Println(&quot;Hello, 안녕 &quot;) } hello.go
    7. 7. Compiler <ul><ul><li>gc x86-64:  6g,   6l x86-32:  8g, 8l arm:  5g, 5l   (incomplete) </li></ul></ul><ul><ul><li>gccgo - new frontend for gcc (gcc 4.6 or later) </li></ul></ul>
    8. 8. Variables declaration <ul><li>var   i int </li></ul><ul><li>var s string </li></ul><ul><li>i = 15 </li></ul><ul><li>s = &quot;foo&quot; </li></ul>i := 15 s := &quot;foo&quot; i, s := 15, &quot;foo&quot; var (     i int     s string )
    9. 9. Functions   1/3 <ul><li>func f() { </li></ul><ul><li>} </li></ul><ul><li>func f(i int) { </li></ul><ul><li>} </li></ul><ul><li>func f(i int) (bool) { </li></ul><ul><li>} </li></ul><ul><li>func f(i int) ( b bool ) { // named result parameter </li></ul><ul><li>    b = true </li></ul><ul><li>    return </li></ul><ul><li>} </li></ul>
    10. 10. Functions   2/3 <ul><li>// Multiple return values </li></ul><ul><li>func Open(path string) ( file *File, err Error ) { </li></ul><ul><li>} </li></ul><ul><li>file, err := Open(&quot;file&quot;) </li></ul><ul><li>file, _ := Open(&quot;file&quot;) </li></ul>
    11. 11. Functions   3/3 <ul><li>func main() { </li></ul><ul><li>    f := func (s string) { </li></ul><ul><li>        println(&quot;Hello, &quot; + s) </li></ul><ul><li>    } </li></ul><ul><li>    callback(f) </li></ul><ul><li>} </li></ul><ul><li>func callback(f func(string) ) { </li></ul><ul><li>    f(&quot;World&quot;) </li></ul><ul><li>} </li></ul>
    12. 12. if <ul><li>if x > 0 { </li></ul><ul><li>    return y </li></ul><ul><li>} else { </li></ul><ul><li>    return x </li></ul><ul><li>} </li></ul><ul><li>if err := file.Chmod(0664) ; err != nil { </li></ul><ul><li>} </li></ul>
    13. 13. for <ul><li>for { </li></ul><ul><li>} </li></ul><ul><li>for err != nil { </li></ul><ul><li>} </li></ul><ul><li>for i := 0; i < 10; i++ { </li></ul><ul><li>} </li></ul><ul><li>LOOP: for { </li></ul><ul><li>    // do something </li></ul><ul><li>    if error_occurred { </li></ul><ul><li>        break LOOP </li></ul><ul><li>    } </li></ul><ul><li>} </li></ul>list := []string{&quot;a&quot;, &quot;b&quot;, &quot;c&quot;} for k, v := range list { }
    14. 14. switch <ul><li>switch { </li></ul><ul><li>case a > b: </li></ul><ul><li>    return true </li></ul><ul><li>case a < b: </li></ul><ul><li>    return false </li></ul><ul><li>} </li></ul><ul><li>switch c { </li></ul><ul><li>case '+', '-', '*', '/' : </li></ul><ul><li>    return true </li></ul><ul><li>} </li></ul><ul><li>return false </li></ul>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 }
    15. 15. Types <ul><li>uint8 </li></ul><ul><li>uint16 </li></ul><ul><li>uint32 </li></ul><ul><li>uint64 </li></ul><ul><li>int8 </li></ul><ul><li>int16 </li></ul><ul><li>int32 </li></ul><ul><li>int64 </li></ul><ul><li>float32 </li></ul><ul><li>float64 </li></ul>complex64 complex128 byte bool uint int uintptr string array slice map pointer // no pointer arithmetic const struct interface channel
    16. 16. Conversions   1/2 <ul><li>var f float32 </li></ul><ul><li>var i uint32 </li></ul><ul><li>f = 3.14159 </li></ul><ul><li>i = uint32 (f) </li></ul><ul><li>fmt.Printf(&quot;%v, %v&quot;, i, f) </li></ul><ul><li>Output: </li></ul><ul><li>3, 3.14159 </li></ul>
    17. 17. Conversions   2/2 <ul><li>mystring := &quot;Hello, Go&quot; </li></ul><ul><li>byteslice := []byte (mystring) </li></ul><ul><li>b := []byte{'H', 'e', 'l', 'l', 'o'} </li></ul><ul><li>s := string (b) </li></ul>
    18. 18. const <ul><li>Constants can only be numbers, strings or booleans. </li></ul>const (      FATAL = iota      ERROR     WARN     INFO     DEBUG     TRACE ) const a = 1 const (     a = 1     b = &quot;go&quot; )
    19. 19. Arrays <ul><li>var arr [3]int </li></ul><ul><li>arr[0] = 1 </li></ul><ul><li>arr[1] = 2 </li></ul><ul><li>arr[2] = 3 </li></ul>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} }
    20. 20. Slices   1/2 <ul><li>A slice is a reference to a section of an array. </li></ul><ul><li>ar := [3]int{1, 2, 3} </li></ul><ul><li>var sl []int   // without a size </li></ul><ul><li>sl = ar[ 0:2 ] </li></ul><ul><li>fmt.Printf(&quot;%v&quot;, sl) </li></ul><ul><li>Output: </li></ul><ul><li>[1, 2] </li></ul>
    21. 21. Slices   2/2 <ul><li>ar[ :n ]   ==   ar[0:n] </li></ul><ul><li>ar[ n: ]   ==   ar[n:len(ar)] </li></ul><ul><li>ar[ : ]     ==   ar[0:len(ar)] </li></ul>
    22. 22. Maps <ul><li>var m map[string]int </li></ul><ul><li>monthdays := map [ string ] int { </li></ul><ul><li>                                &quot; Jan &quot;: 31 , &quot;Feb&quot;: 28, &quot;Mar&quot;: 31, </li></ul><ul><li>                                &quot;Apr&quot;: 30, &quot;May&quot;: 31, &quot;Jun&quot;: 30, </li></ul><ul><li>                                &quot;Jul&quot;: 31, &quot;Aug&quot;: 31, &quot;Sep&quot;: 30, </li></ul><ul><li>                                &quot;Oct&quot;: 31, &quot;Nov&quot;: 30, &quot;Dec&quot;: 31   } </li></ul><ul><li>monthdays[&quot;Feb&quot;] = 29 </li></ul><ul><li>monthdays[&quot; Unknown &quot;] = 32 </li></ul>
    23. 23. Structs <ul><li>type Point struct { </li></ul><ul><li>    x, y float64 </li></ul><ul><li>} </li></ul><ul><li>var p Point </li></ul><ul><li>p.x = 7 </li></ul><ul><li>p.y = 23.4 </li></ul><ul><li>var pp *Point = new(Point) </li></ul><ul><li>*pp = p </li></ul><ul><li>pp.x = 3.14   // sugar for (*pp).x                           // There is no -> notation </li></ul>
    24. 24. new() vs make() <ul><ul><li>new returns pointers. t := new(T) </li></ul></ul><ul><ul><li>make returns initialized values.   Use make to create   slices ,   maps , and   channels   only. sl := make([]int, 10)   //   sl refers to a new array of 10 ints sl := new([]int, 10)     //   Allocates slice structure; *sl == nil </li></ul></ul>
    25. 25. Methods <ul><li>type Point struct { </li></ul><ul><li>    x, y int </li></ul><ul><li>} </li></ul><ul><li>func (p *Point) Get () (int, int) { </li></ul><ul><li>    return p.x, p.y </li></ul><ul><li>} </li></ul><ul><li>func (p Point) Put (x, y int) {   // unexpected behavior </li></ul><ul><li>    p.x = x; p.y = y </li></ul><ul><li>} </li></ul>
    26. 26. interfaces <ul><li>type   Point   struct   {   x, y int   } </li></ul><ul><li>func   (p *Point)   Get () (int, int)   {   return p.x, p.y   } </li></ul><ul><li>func   (p *Point)   Put (x, y int)   {   p.x = x; p.y = y   } </li></ul><ul><li>type   Pointer interface { </li></ul><ul><li>    Get() (int, int) </li></ul><ul><li>    Put(x, y int) </li></ul><ul><li>} </li></ul>
    27. 27. delegation <ul><li>type MorePointer struct { </li></ul><ul><li>Point   // anonymous field </li></ul><ul><li>z int </li></ul><ul><li>} </li></ul><ul><li>func (p *MorePointer) Get() (int, int, int) { </li></ul><ul><li>return p.x, p.y , p.z </li></ul><ul><li>} </li></ul><ul><li>m := MorePointer{ Point{1, 2} , 3} </li></ul><ul><li>fmt.Println(m.Get()) </li></ul>
    28. 28. defer   1/2 <ul><li>func ReadWrite() bool { </li></ul><ul><li>     file.Open(&quot;file&quot;) </li></ul><ul><li>     // do somthing... </li></ul><ul><li>     if failureX { </li></ul><ul><li>         file.Close()   </li></ul><ul><li>         return false </li></ul><ul><li>     } </li></ul><ul><li>     if failureY { </li></ul><ul><li>         file.Close()   </li></ul><ul><li>         return false </li></ul><ul><li>     } </li></ul><ul><li>     file.Close()   </li></ul><ul><li>     return true </li></ul><ul><li>} </li></ul>func ReadWrite() bool {      file.Open(&quot;file&quot;)     defer file.Close()      // do somthing...      if failureX {            return false      }      if failureY {          return false      }      return true }
    29. 29. defer   2/2 <ul><li>func f() { </li></ul><ul><li>    for i := 0; i < 5; i++ { </li></ul><ul><li>        defer print(i)   // LIFO order </li></ul><ul><li>    } </li></ul><ul><li>} </li></ul><ul><li>Output: </li></ul><ul><li>43210 </li></ul>
    30. 30. goroutine   1/2 <ul><li>func ready(w string, sec int64) { </li></ul><ul><li>     time.Sleep(sec * 1e9) </li></ul><ul><li>     fmt.Println(w, &quot;is ready!&quot;) </li></ul><ul><li>} </li></ul><ul><li>func main() { </li></ul><ul><li>     go ready(&quot;Tee&quot;, 2) </li></ul><ul><li>     go ready(&quot;Coffee&quot;, 1) </li></ul><ul><li>     fmt.Println(&quot;I'm waiting&quot;) </li></ul><ul><li>     time.Sleep(5 * 1e9) </li></ul><ul><li>} </li></ul><ul><li>Output: </li></ul><ul><li>I'm waiting         <- Right away </li></ul><ul><li>Coffee is ready   <- After 1 second </li></ul><ul><li>Tee is ready       <- After 2 second </li></ul>
    31. 31. goroutine   2/2 <ul><li>goroutines were running concurrent, they were not running in parallel. </li></ul><ul><li>To run in parallel: </li></ul><ul><li>runtime.GOMAXPROCS(n) </li></ul><ul><li>or </li></ul><ul><li>GOMAXPROCS   environment varaible </li></ul>
    32. 32. channel <ul><li>c := make(chan int) </li></ul><ul><li>c <- 1       // send 1 on c (flowing into c) </li></ul><ul><li><-c         // receive value, throw it away </li></ul><ul><li>i := <-c    // receive value, initialize i </li></ul>
    33. 33. channel <ul><li>var c chan int </li></ul><ul><li>func ready(w string, sec int64) { </li></ul><ul><li>     time.Sleep(sec * 1e9) </li></ul><ul><li>     fmt.Println(w, &quot;is ready!&quot;) </li></ul><ul><li>    c <- 1 </li></ul><ul><li>} </li></ul><ul><li>func main() { </li></ul><ul><li>      c = make(chan int)       // synchronous channels </li></ul><ul><li>     go   ready(&quot;Tee&quot;, 2) </li></ul><ul><li>     go   ready(&quot;Coffee&quot;, 1) </li></ul><ul><li>     fmt.Println(&quot;I'm waiting&quot;) </li></ul><ul><li>     ret := <-c </li></ul><ul><li>     ret = <-c </li></ul><ul><li>} </li></ul>
    34. 34. You.rl with MongoDB (Simple URL shortener example)
    35. 35. Requirements <ul><ul><li>Create shortened URL. Do not duplicate keys </li></ul></ul><ul><ul><li>Save { &quot;Shortened_URL&quot; : &quot;Long_URL&quot; } </li></ul></ul><ul><ul><li>Redirect to long url when shortened URL requested </li></ul></ul>
    36. 36. View source https://github.com/golang-korea/You.RL
    37. 37. You.rl demo
    38. 38. tools <ul><li>gomake </li></ul><ul><li>goinstall </li></ul><ul><li>godoc </li></ul><ul><li>gofix </li></ul><ul><li>gofmt </li></ul><ul><li>gotest </li></ul><ul><li>cgo </li></ul><ul><li>...... </li></ul>
    39. 39. Packages <ul><li>http://golang.org/pkg/ </li></ul>
    40. 40. Go project dashboard <ul><li>http://godashboard.appspot.com/project </li></ul>
    41. 41. Try Go today! http://golang.org

    ×