mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 03:01:48 +00:00
Use TOML output for -print-config instead of JSON.
This is much easier to read, and can be used as a template for a new configuration.
This commit is contained in:
@@ -166,8 +166,8 @@ type ObservabilityConfig struct {
|
||||
SlowResponseThreshold Duration `toml:"slow-response-threshold" default:"500ms"`
|
||||
}
|
||||
|
||||
func (config *Config) DebugJSON() string {
|
||||
result, err := json.MarshalIndent(config, "", " ")
|
||||
func (config *Config) TOML() string {
|
||||
result, err := toml.Marshal(config)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
@@ -269,7 +269,7 @@ func Main() {
|
||||
}
|
||||
|
||||
if *printConfig {
|
||||
fmt.Println(config.DebugJSON())
|
||||
fmt.Println(config.TOML())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user