Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go 기초 문서 읽기 #255

Open
8 of 14 tasks
eubnara opened this issue Dec 28, 2021 · 4 comments
Open
8 of 14 tasks

go 기초 문서 읽기 #255

eubnara opened this issue Dec 28, 2021 · 4 comments
Labels

Comments

@eubnara eubnara added the GO label Dec 28, 2021
@eubnara
Copy link
Owner Author

eubnara commented Dec 28, 2021

https://go.dev/doc/tutorial/getting-started

  • https://pkg.go.dev 에서 패키지 찾는 방법
  • go mod tidy 로 모듈 요구사항 및 sum 받기

@eubnara
Copy link
Owner Author

eubnara commented Dec 28, 2021

https://go.dev/doc/tutorial/create-module

go 파일 -> 패키지 -> 모듈

# 로컬 모듈 참조하게 만들기
go mod edit -replace example.com/greetings=../greetings

# semantic version number 가 없는 로컬 모듈에 대해서  pseudo-version number 를 추가한다.
go mod tidy

@eubnara
Copy link
Owner Author

eubnara commented Dec 29, 2021

https://go.dev/tour/flowcontrol/13

defer 로 함수호출을 하면 stack 형태로 last in first out 호출이 된다.

@eubnara
Copy link
Owner Author

eubnara commented Dec 29, 2021

type assertions
https://go.dev/tour/methods/15

t := i.(T) // T 타입이 아니면 panic 발생할 수 있음
t, ok := i.(T) // T 타입이 아니어도 panic 발생하지 않음

map 을 접근하는 형태와 유사

elem = m[key]
elem, ok := m[key]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant