yaml & anchor and aliases *

&Used to create an anchor point ( defaults), <<represents the merged into the current data, *is used to reference anchor.

example:

defaults: &defaults
  adapter:  postgres
  host:     localhost

development:
  database: myapp_development
  <<: *defaults

test:
  database: myapp_test
  <<: *defaults
- &showell Steve 
- Clark 
- Brian 
- Oren 
- *showell 

  

actual use:

 

Learning Link: http: //www.ruanyifeng.com/blog/2016/07/yaml.html f = tt?

 

Guess you like

Origin www.cnblogs.com/erinchen/p/10619172.html