반응형
YAML에서 코드 블록 재사용
Defaults: &defaults
Company: Foo
Item: 123
Computer: *defaults
Price: 3000
그러나 이로 인해 오류가 발생합니다.
이와 같이 각 필드 값을 별도로 고정하는 유일한 방법 입니까?
Defaults:
Company: &company Foo
Item: &item 123
Computer:
Company: *company
Item: *item
Price: 3000
# sequencer protocols for Laser eye surgery
---
- step: &id001 # defines anchor label &id001
instrument: Lasik 2000
pulseEnergy: 5.4
pulseDuration: 12
repetition: 1000
spotSize: 1mm
- step: &id002
instrument: Lasik 2000
pulseEnergy: 5.0
pulseDuration: 10
repetition: 500
spotSize: 2mm
- step: *id001 # refers to the first step (with anchor &id001)
- step: *id002 # refers to the second step
- step: *id001
- step: *id002
위키 백과의 샘플
전체 그룹을 가져 와서 재사용 해보십시오.
Defaults: &defaults
Company: foo
Item: 123
Computer:
<<: *defaults
Price: 3000
문서 : http://yaml.org/type/merge.html
참고 URL : https://stackoverflow.com/questions/8466223/reuse-a-block-of-code-in-yaml
반응형
'UFO ET IT' 카테고리의 다른 글
phpmyadmin이 포함 된 PHP 7은 많은 지원 중단 알림을 제공합니다. (0) | 2020.12.13 |
---|---|
OSX의 MAMP에서 Apache가 시작되지 않지만 MySQL은 작동합니다. (0) | 2020.12.13 |
배경으로 드로어 블 모양, 하단에 선 (0) | 2020.12.13 |
Android-XML의 플립 이미지 (0) | 2020.12.13 |
UITextView 콘텐츠 삽입 (0) | 2020.12.13 |