어우.. 문법이 이해하기 좀 빡세네?
c에서 goto는 해당 위치로 간다는게 직관적이었지만 golang에서 break, continue는 딱 와닫지 않는다.
 
특히나 예제에서 2중 루프를 돌리면 해당 라벨로 점프하는 느낌이 아니라
nested loop만 빠져나가는 것 같은데 어떻게 이해해야하려나?
반대로.. 해당 루프를 continue 하는거니까, 내부 loop를 break 하는걸로 이해하면 되나?
var err error timeout := time.After(30 * time.Second)
  sigChan := make(chan os.Signal, 1) signal.Notify(sigChan, os.Interrupt)
  complete := make(chan error) go launchProcessor(complete)
  Loop:     for {         select {         case <-sigChan:            atomic.StoreInt32(&shutdownFlag, 1)            continue
          case <-timeout:             os.Exit(1)
          case err = <-complete:             break Loop         }     }
  return err | 
 
    guestList := []string{"bill", "jill", "joan"}     arrived := []string{"sally", "jill", "joan"}
  CheckList:     for _, guest := range guestList {         for _, person := range arrived {             fmt.Printf("Guest[%s] Person[%s]\n", guest, person)
              if person == guest {                 fmt.Printf("Let %s In\n", person)                 continue CheckList             }         }     } | 
[링크 : https://www.ardanlabs.com/blog/2013/11/label-breaks-in-go.html]
[링크 : https://pyrasis.com/book/GoForTheReallyImpatient/Unit17/01]
 
goto는 한 함수 내에서 label이 유효하여 아래와 같이 다른 함수를 넘나들순 없게 구성되었다고 한다.
c와의 차이점이라고 해야하나..
package main 
  import "fmt" 
  func main() {  learnGoTo()  } 
  func learnGoTo() {  fmt.Println("a")  goto FINISH  fmt.Println("b") 
  } 
  func test() {  FINISH:  fmt.Println("c")  } | 
[링크 : https://golangbyexample.com/goto-statement-go/]
[링크 : https://pyrasis.com/book/GoForTheReallyImpatient/Unit18]