Go 슬라이스 리터럴

Jmnote (토론 | 기여)님의 2022년 2월 10일 (목) 21:58 판 (새 문서: ==개요== ;Go slice literals ;Go 슬라이스 리터럴 <syntaxhighlight lang='go' run> package main import "fmt" func main() { q := []int{2, 3, 5, 7, 11, 13} fmt.Println(q) r...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

Go slice literals
Go 슬라이스 리터럴
package main

import "fmt"

func main() {
	q := []int{2, 3, 5, 7, 11, 13}
	fmt.Println(q)

	r := []bool{true, false, true, true, false, true}
	fmt.Println(r)

	s := []struct {
		i int
		b bool
	}{
		{2, true},
		{3, false},
		{5, true},
		{7, true},
		{11, false},
		{13, true},
	}
	fmt.Println(s)
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}