loader/loader.go
Function LoadFile
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func LoadFile(path string, override *config.Override) (*config.Config, error) {
overridePaths, err := getOverridePaths()
if err != nil {
return nil, fmt.Errorf(
"failed to determine override paths: %s",
Function LoadFile
has 9 return statements (exceeds 4 allowed). Open
Open
func LoadFile(path string, override *config.Override) (*config.Config, error) {
overridePaths, err := getOverridePaths()
if err != nil {
return nil, fmt.Errorf(
"failed to determine override paths: %s",
Method Loader.readOverride
has 6 return statements (exceeds 4 allowed). Open
Open
func (l *Loader) readOverride(path string) (*config.Override, error) {
if override, ok := l.loadedOverrides[path]; ok {
return override, nil
}
Method Loader.readConfigs
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *Loader) readConfigs(path string) error {
if _, ok := l.loadedConfigs[path]; ok {
return nil
}
Function validateConfig
has 5 return statements (exceeds 4 allowed). Open
Open
func validateConfig(path string, data []byte) error {
if err := schema.Validate("schema/config.yaml", data); err != nil {
return fmt.Errorf("failed to validate config %s: %s", path, err.Error())
}
Method Loader.Load
has 5 return statements (exceeds 4 allowed). Open
Open
func (l *Loader) Load(path string) (*config.Config, error) {
path = l.normalizePath(path, "")
if err := l.readConfigs(path); err != nil {
return nil, err
exported type Loader should have comment or be unexported Open
Open
Loader struct {
- Exclude checks
exported method Loader.LoadPathSubstitutions should have comment or be unexported Open
Open
func (l *Loader) LoadPathSubstitutions(overridePaths []string) error {
- Exclude checks
exported function NewLoader should have comment or be unexported Open
Open
func NewLoader() *Loader {
- Exclude checks
exported method Loader.Load should have comment or be unexported Open
Open
func (l *Loader) Load(path string) (*config.Config, error) {
- Exclude checks
exported function LoadFile should have comment or be unexported Open
Open
func LoadFile(path string, override *config.Override) (*config.Config, error) {
- Exclude checks
exported method Loader.ApplyOverrides should have comment or be unexported Open
Open
func (l *Loader) ApplyOverrides(config *config.Config, overridePaths []string) error {
- Exclude checks