영기
article thumbnail
Go Assignability
Pro go 스터디 2025. 6. 17. 16:56

https://go.dev/ref/spec#Assignability기본 용어 정의V: 값 x의 타입 (Value type)T: 할당받을 변수의 타입 (Target type)assignable: x = y 형태의 할당이 유효한지 판단하는 규칙identical : 동일underlying type : named type :element typechannel typesa bidirectional channelinterface typea type parameter포인터/함수/슬라이스/맵/채널/인터페이스 타입 V and T are identicalidentical (var x int = 42var y int = x // ✅ int와 int는 identical V and T have identical underl..

article thumbnail
CH05. Operations and Conversions
Pro go 스터디 2025. 6. 15. 23:03

Understanding the Go Operators Understanding the Arithmetic Operatorspackage mainimport "fmt"func main() { price, tax := 275.00, 27.40 sum := price + tax difference := price - tax product := price * tax quotient := price / tax fmt.Println(sum) fmt.Println(difference) fmt.Println(product) fmt.Println(quotient)} Understanding Arithmetic OverflowGo Interger values..

article thumbnail
CH04. Basic Types, Values, and Pointers
Pro go 스터디 2025. 6. 10. 22:19

package mainfunc main() { x := 100 ptr := &x // 이런 포인터 산술들은 모두 컴파일 에러 발생 ptr = ptr + 1 ptr = ptr - 1 ptr += 4 ptr++}​package mainimport ( "fmt" "math/rand")func main() { fmt.Println(rand.Int())} Go Standard Libary Basic Data Types complex복소수 complex64: 64비트 (32비트 실수부 + 32비트 허수부) complex128: 128비트 (64비트 실수부 + 64비트 허수부)package mainimport "fmt"func main() { // 복소수 생성 a := 3 + 4i b := 1 + 2i fmt.P..

article thumbnail
CH03. Using the Go Tools
Pro go 스터디 2025. 6. 10. 22:04

cmd/gohttps://pkg.go.dev/cmd/goUsage: go [arguments] command:bug start a bug reportbuild compile packages and dependenciesclean remove object files and cached filesdoc show documentation for package or symbolenv print Go environment informationfix update packages to use new APIsfmt gofmt (reformat) package sourcesgenerate generate Go files ..

CH2. PUTTING GO IN CONTEXT(Go를 맥락에서 이해하기)
Pro go 스터디 2025. 6. 6. 18:50

책구조1부 Go언어 이해하기내장 데이터 타입커스텀 타입 생성흐름 제어오류 처리동시성 2부 Go 표준 라이브러리 사용하기문자열 형식 지정데이터 읽기 & 쓰기HTTP 서버Client 생성DB사용리플렉션 3부 Go 적용하기Go를 사용하여 커스텀 웹 애플리케이션 프레임워크 만들기 (SportsStore) 이책에서 다루지 않는 것Go 표준 라이브러리에서 제공하는 모든 패키지를 다루지 않음

article thumbnail
CH1. Go Data Structures
Pro go 스터디 2025. 6. 5. 23:19

출처 : https://research.swtch.com/godata research!rsc: Go Data StructuresGo Data Structures Posted on Tuesday, November 24, 2009. When explaining Go to new programmers, I've found that it often helps to explain what Go values look like in memory, to build the right intuition about which operations are expensive and which are noresearch.swtch.comBasic types 변수 i int 타입represented in memory as a si..

article thumbnail
CH1. Your First Go Application
Pro go 스터디 2025. 6. 4. 22:56

상황설정친구가 신년 파티를 주최하기로 했고, 초대받은 사람들이 전자적으로 RSVP할 수 있는 웹앱을 만들어 달라고 나에게 요청했다고 상상해보세요. 그녀가 요청한 주요 기능들은 다음과 같습니다- 파티 정보를 보여주는 홈페이지 - RSVP에 사용할 수 있는 양식 (감사 페이지를 표시함) - RSVP 양식이 제대로 작성되었는지 확인하는 유효성 검사 - 파티에 누가 오는지 보여주는 요약 페이지https://github.com/apress/pro-go Installing the Development Tools 기존에 설치되어 있던 go 삭제 후 재설치 Creating the Project go.mod 파일go.mod 파일의 역할 : Go 모듈을 정의하고 모듈의 속성(의존성, Go 버전 등)을 설명4가지 핵..

검색 태그