YAML2 [Golang] YAML 파싱하기 Go언어에서 YAML 라이브러리를 이용하면 간편하게 YMAL 값을 다룰 수 있다. 해당 라이브러리의 문서는 아래에서 확인할 수 있다. https://pkg.go.dev/gopkg.in/yaml.v3 간단하게 YAML를 언마샬링 하는 예제를 확인해보자. - person.yaml name: Martin D'vloper job: Developer skill: Elite employed: True foods: - Apple - Orange - Strawberry - Mango languages: perl: Elite python: Elite 이전에 학습했듯이 json를 다루는 방식과 거의 동일하다. - [go] JSON 다루기 필드 태그 형식은 다음과 같다. yaml:"[][,[,]]" package main .. 2021. 6. 12. Spring Boot profile 환경별 설정하기(YAML) Spring Boot에서 로컬, 개발, 실서비스 같은 여러 환경을 하나의 application.yml 파일에 설정하고 사용하는 방법에 대해서 알아보자. YAML 설정 하나의 application.yml 파일에 여러 환경의 설정 정보를 저장하려면 spring.profiles 를 통해 설정하면 된다. ---)로 구분 한다. # local, dev, prod 공통 설정 server: port: 8080 tomcat: uri-encoding: UTF-8 --- spring: profiles: local datasource: url: "jdbc:mysql://test-server/test" username: "dbuser" password: "dbpass" --- spring: profiles: dev datas.. 2021. 5. 15. 이전 1 다음