GO Basic

GO Basic #


Go 기본적인 문법 정리. 하기 사이트 참조.

예제로 배우는 Go 프로그래밍

Hello World #

package main

func main() {
    println("Hello World!")
}

Declare #

선언 및 할당 방식

Reserved Keywords #

GO 25개 예약어

break, case, chan, const, continue, const, default, const, defer, else,fallthrough, for, func, go, goto, if, import, interface, map, package, range, return, select, struct, switch, type, var

Declaration of Varialbe and Operators #

변수 선언 및 연산자

Conditional Statement #

Iteration #

‘goto END’는 END 레이블로 이동 ‘break L1’은 break 레이블로 위치를 이동.

Method #

Array / Slice / Map #

배열은 연속적인 메모리 공간에 동일한 타입의 데이터를 순서적으로 저장하는 자료구조. 슬라이스는 내부적으로 배열에 기초하여 만들어졌으나 크기를 동적으로 변할 수도 있고 부분 배열을 발췌할 수 있음.

Map은 Key에 대응하는 Value를 찾는 Hash Table을 구현한 자료구조.

Package #

Struct #

Method / Interface #

Error / Defer / Panic / Recover #

Goroutine / Channel #

Source : github-go_basic


<< 이전글 다음글 >>



comments powered by Disqus