我使用 Viper https://github.com/spf13/viper来管理 GO 应用程序中的项目配置,以及将配置值解组到结构体。
var config c.Configuration // Configuration is my configuration struct
err := viper.Unmarshal(&config)
Run Code Online (Sandbox Code Playgroud)
当我错过 .yml 配置文件中的某些配置时,它在解组期间不会抛出任何错误(正如我所猜测的)。
那么我怎样才能强制实施所有配置呢?如果结构体中的任何字段在 yaml 中没有值,我想查看错误。
Java编译器错误:string too large to encode using UTF-8 written instead as 'STRING_TOO_LARGE'.
我想要注意的是,我没有长字符串,没有一个矢量可绘制大于32kb(最大是3.7kb).
Gradle 3.2.0,构建工具28.0.3
什么可以带来问题?