🐾   [Error] panic: Record map key is not string 해결방안

# 오류메시지

panic: Record map key is not string


문자열이 아니라고 해서 디버깅을 했다. DB안에 있는 no: 2가 false->2 이렇게 들어간다. 그래서 string이 아니라는 메시지가 계속 나왔다 그래서 test DB에서 no: 2 삭제 했더니 코드가 정상으로 돌아갔다. img

# 수정 전

- no: 2
id:
password:
business_registration_number:
mobile:
created: null
updated: null
deleted_at: null

# 수정 후

- id:
password:
business_registration_number:
created: null
updated: null
deleted_at: null

★YAML이 bool를 yes, no으로 읽는다. 그래서 no를 적으면 false로 바뀌는 것 같다.

# 새로 알게된 사실

JSON의 불편함을 해소하기 위해 YAML 사용한다.

​ ​ ​