NewDefaultClientConfigLoadingRules returns a ClientConfigLoadingRules object with default fields filled in. You are not required to use this constructor
()
| 135 | // NewDefaultClientConfigLoadingRules returns a ClientConfigLoadingRules object with default fields filled in. You are not required to |
| 136 | // use this constructor |
| 137 | func NewDefaultClientConfigLoadingRules() *ClientConfigLoadingRules { |
| 138 | chain := []string{} |
| 139 | |
| 140 | envVarFiles := os.Getenv(RecommendedConfigPathEnvVar) |
| 141 | if len(envVarFiles) != 0 { |
| 142 | fileList := filepath.SplitList(envVarFiles) |
| 143 | // prevent the same path load multiple times |
| 144 | chain = append(chain, deduplicate(fileList)...) |
| 145 | |
| 146 | } else { |
| 147 | chain = append(chain, RecommendedHomeFile) |
| 148 | } |
| 149 | |
| 150 | return &ClientConfigLoadingRules{ |
| 151 | Precedence: chain, |
| 152 | MigrationRules: currentMigrationRules(), |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | // Load starts by running the MigrationRules and then |
| 157 | // takes the loading rules and returns a Config object based on following rules. |
no test coverage detected