From 2bd5ae11a79b00fa540022ca7e428257c7c8da5f Mon Sep 17 00:00:00 2001 From: Brian Hendriks Date: Fri, 24 Mar 2023 11:14:43 -0700 Subject: [PATCH] omit some empty fields --- go/cmd/dolt/commands/sqlserver/yaml_config.go | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/go/cmd/dolt/commands/sqlserver/yaml_config.go b/go/cmd/dolt/commands/sqlserver/yaml_config.go index 86d10ae395..c5d7c6db61 100644 --- a/go/cmd/dolt/commands/sqlserver/yaml_config.go +++ b/go/cmd/dolt/commands/sqlserver/yaml_config.go @@ -100,7 +100,7 @@ type ListenerYAMLConfig struct { // AllowCleartextPasswords enables use of cleartext passwords. AllowCleartextPasswords *bool `yaml:"allow_cleartext_passwords"` // Socket is unix socket file path - Socket *string `yaml:"socket"` + Socket *string `yaml:"socket,omitempty"` } // PerformanceYAMLConfig contains configuration parameters for performance tweaking @@ -129,24 +129,24 @@ type UserSessionVars struct { // YAMLConfig is a ServerConfig implementation which is read from a yaml file type YAMLConfig struct { - LogLevelStr *string `yaml:"log_level"` - MaxQueryLenInLogs *int `yaml:"max_logged_query_len"` - EncodeLoggedQuery *bool `yaml:"encode_logged_query"` + LogLevelStr *string `yaml:"log_level,omitempty"` + MaxQueryLenInLogs *int `yaml:"max_logged_query_len,omitempty"` + EncodeLoggedQuery *bool `yaml:"encode_logged_query,omitempty"` BehaviorConfig BehaviorYAMLConfig `yaml:"behavior"` UserConfig UserYAMLConfig `yaml:"user"` ListenerConfig ListenerYAMLConfig `yaml:"listener"` DatabaseConfig []DatabaseYAMLConfig `yaml:"databases"` PerformanceConfig PerformanceYAMLConfig `yaml:"performance"` - DataDirStr *string `yaml:"data_dir"` - CfgDirStr *string `yaml:"cfg_dir"` + DataDirStr *string `yaml:"data_dir,omitempty"` + CfgDirStr *string `yaml:"cfg_dir,omitempty"` MetricsConfig MetricsYAMLConfig `yaml:"metrics"` RemotesapiConfig RemotesapiYAMLConfig `yaml:"remotesapi"` - ClusterCfg *ClusterYAMLConfig `yaml:"cluster"` - PrivilegeFile *string `yaml:"privilege_file"` - BranchControlFile *string `yaml:"branch_control_file"` + ClusterCfg *ClusterYAMLConfig `yaml:"cluster,omitempty"` + PrivilegeFile *string `yaml:"privilege_file,omitempty"` + BranchControlFile *string `yaml:"branch_control_file,omitempty"` Vars []UserSessionVars `yaml:"user_session_vars"` Jwks []engine.JwksConfig `yaml:"jwks"` - GoldenMysqlConn *string `yaml:"golden_mysql_conn"` + GoldenMysqlConn *string `yaml:"golden_mysql_conn,omitempty"` } var _ ServerConfig = YAMLConfig{}