工作经验篇: yml 配置文件提示错误mapping values are not allowed in this context

Golang
472
0
0
2022-05-09

工作经验篇: yml 配置文件提示错误mapping values are not allowed in this context

今天开发遇到了 错误

如下

API server listening at: 127.0.0.1:49819
time="2021-07-05T14:05:26+08:00" level=info msg="starting api server\n"
time="2021-07-05T14:05:26+08:00" level=fatal msg="Parse config file fail: While parsing config: yaml: line 32: mapping values are not allowed in this context"

Debugger finished with exit code 0

yml 配置文件提示错误

解决,这里其实你不需要四处排查代码.

错误肯定就是你的yml配置文件地方

我已经标注了红色,就是多了 tab…..

修正后代码如图:

yml 配置文件提示错误

yml 配置文件提示错误mapping values are not allowed in this context