用到包"github.com/spf13/viper"
1. 启动命令 CORE_SECURITY_ENABLED=true vip
在代码中通过environment := viper.GetBool(“security.enabled”)
可得到environment的值为true
2. 读取配置文件,配置文件结构如下core.yaml
statetransfer:
# Should a replica attempt to fix damaged blocks?
# In general, this should be set to true, setting to false will cause
# the replica to panic, and require a human's intervention to intervene
# and fix the corruption
recoverdamage: true
# The number of blocks to retrieve per sync requ