Skip to content

Commit 6255971

Browse files
author
Abdelkarim Boujida
committed
Fix issue with loop and element address
1 parent f640da8 commit 6255971

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

internal/provider/provider.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ func (p *CloudSqlPostgresqlProvider) Configure(ctx context.Context, req provider
133133

134134
dbConfig := NewConfig()
135135

136-
for k, connectionConfig := range config.Connections {
136+
for k, cc := range config.Connections {
137+
connectionConfig := cc // to understand why, refer to https://stackoverflow.com/questions/44044245/register-multiple-routes-using-range-for-loop-slices-map/44045012#44045012
137138
connectionConfigsPath := path.Root("connection_configs").AtMapKey(k)
138139
if connectionConfig.ConnectionName.IsUnknown() {
139140
resp.Diagnostics.AddAttributeError(connectionConfigsPath.AtName("connection_name"),

0 commit comments

Comments
 (0)