์ด๋ฌํ stuct๋ฅผ ๊ฐ์ํ ๋ :
type Path struct {
Description string
Paths map[string]Path
}
type Top struct {
Title string
Path
}
๋ค์๊ณผ ๊ฐ์ด YAML์ ๋น์ ๋ ฌํํ ์ ์์ด์ผ ํฉ๋๋ค.
title: Recursive
paths:
a:
paths:
b:
paths:
c:
description: Bottom
์ด๊ฒ์ ์๋ํ์ง๋ง ์์ ๊ฐ์์ผ ํฉ๋๋ค.
type Path struct {
Description string
Paths map[string]Path
}
type Top struct {
Title string
Paths map[string]Path
}
๋ฌธ์์ ๋ฐ๋ผ ,inline
ํ๋๊ทธ๊ฐ ํ์ํฉ๋๋ค.
http://gopkg.in/yaml.v2#๋ง์ฌ
์ผ๋ฐ ํ๋์ ์ต๋ช ํ๋ ๋ชจ๋์์ ํด๋น ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
:+1: ์ฃ์กํฉ๋๋ค. ์์์: RTFM @rnix :gun:
๋ฌธ์ ์์ด์. ;-)
๊ทธ๋ฆฌ๊ณ ๋ฌธ์ ๋ฅผ ์ ์ถํด ์ฃผ์ ์ ๊ฐ์ฌํฉ๋๋ค. ์ ํจํ ๋ฌธ์ ์ผ ์ ์์ต๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ฌธ์์ ๋ฐ๋ผ
,inline
ํ๋๊ทธ๊ฐ ํ์ํฉ๋๋ค.http://gopkg.in/yaml.v2#๋ง์ฌ
์ผ๋ฐ ํ๋์ ์ต๋ช ํ๋ ๋ชจ๋์์ ํด๋น ํ๋๊ทธ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.