(tfState TerraformState, configObject interface{})
| 13 | ) |
| 14 | |
| 15 | func MapBackendConfig(tfState TerraformState, configObject interface{}) error { |
| 16 | functionName := "LoadBackendConfig" |
| 17 | |
| 18 | config := &mapstructure.DecoderConfig{TagName: "json"} |
| 19 | config.Result = &configObject |
| 20 | |
| 21 | decoder, decodeInitErr := mapstructure.NewDecoder(config) |
| 22 | if decodeInitErr != nil { |
| 23 | return fmt.Errorf("creating map decoder failed -> %v: %w", functionName, decodeInitErr) |
| 24 | } |
| 25 | |
| 26 | decodeErr := decoder.Decode(tfState.Backend.Config) |
| 27 | if decodeInitErr != nil { |
| 28 | return fmt.Errorf("decoding backend config failed -> %v: %w", functionName, decodeErr) |
| 29 | } |
| 30 | |
| 31 | return nil |
| 32 | } |
| 33 | |
| 34 | func LoadBackendConfig() (TerraformState, error) { |
| 35 | functionName := "LoadBackendConfig" |
no outgoing calls
no test coverage detected