We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在解析yaml时候遇到了解析出错: yam文件格式如下:
--- id: VEHICLE-RFID-0807112517 name: vehicle rfid pipeline properties: kafka.bootstrap.servers: hdh98:9092,hdh197:9092,hdh199:9092 kafka.zookeeper.connector: hdh98:2181,hdh197:2181,hdh199:2181 hbase.zookeeper.quorum: hdh98:2181,hdh197:2181,hdh199:2181 hbase.zookeeper.property.clientPort: 2181
查看了错误原因是因为解析时候对key的分割处理导致的。 read.go 文件中,144行处。
if !strings.Contains(key, ".") { // c.addError(errNotFound) return } keys := strings.Split(key, ".") topK := keys[0]
修改后:
if !strings.Contains(key, ":") { // c.addError(errNotFound) return } keys := strings.Split(key, ":") topK := keys[0]
在解析文件中希望可以修改,修改后查询使用的方式如下: value2 := cfg.String("topics:0:properties:cleanup.policy")
value2 := cfg.String("topics:0:properties:cleanup.policy")
The text was updated successfully, but these errors were encountered:
@tank411 现在调整了下,支持自定义key的分隔符:
config/config_test.go
Lines 324 to 338 in 4388758
全局配置:
import github.com/gookit/config config.WithOptions(config.Delimiter(':')) // ... config.String("properties:kafka.bootstrap.servers")
Sorry, something went wrong.
inhere
No branches or pull requests
在解析yaml时候遇到了解析出错:
yam文件格式如下:
查看了错误原因是因为解析时候对key的分割处理导致的。
read.go 文件中,144行处。
修改后:
在解析文件中希望可以修改,修改后查询使用的方式如下:
value2 := cfg.String("topics:0:properties:cleanup.policy")
The text was updated successfully, but these errors were encountered: