Fix lint issue
Linter was complaining about possibly nil dereferences,
but these are already checked with an assertion.
@@ -669,7 +669,8 @@ func makeResourceState(t, name string, resourceV Resource, providers map[string]
state.outputs["id"] = crs.id
}
- // Populate ResourceState resolvers.
+ // Populate ResourceState resolvers. (Pulled into function to keep the nil-ness linter check happy).
+ populateResourceStateResolvers := func() {
contract.Assert(rs != nil)
rs.providers = providers
rs.urn = URNOutput{newOutputState(urnType, resourceV)}
@@ -680,6 +681,8 @@ func makeResourceState(t, name string, resourceV Resource, providers map[string]
rs.aliases = aliases
state.transformations = transformations
rs.transformations = transformations
+ }
+ populateResourceStateResolvers()
return state
}
