jinzhu / configor

Golang Configuration tool that support YAML, JSON, TOML, Shell Environment
MIT License
1.74k stars 204 forks source link

Does it not support camel case naming #74

Closed lmxdawn closed 2 years ago

lmxdawn commented 2 years ago

Does it not support camel case naming

joe-at-startupmedia commented 1 week ago

FYI, if you're using CamelCase struct field names and want to use configuration formats interoperably you have to specify all of the supported format annotations.

type ExecFlags struct {
    User          string   `json:"user"`
    Log           string   `json:"log,omitempty"`
    LogDir        string   `json:"log_dir,omitempty" yaml:"log_dir" toml:"log_dir"`
    Args          string   `json:"args"`
    EnvVars       string   `json:"env_vars,omitempty" yaml:"env_vars" toml:"env_vars"`
    Name          string   `json:"name"`
    Dependencies  []string `json:"dependencies,omitempty"`
    Groups        []string `json:"groups,omitempty"`
    NoAutoRestart bool     `json:"no_auto_restart" yaml:"no_auto_restart" toml:"no_auto_restart"`
}