func withModuleSourceAndVersion[T moduleSource]()

in internal/provider/module_source_interface.go [20:32]


func withModuleSourceAndVersion[T moduleSource](data T) T {
	data.SetModuleSource(basetypes.NewStringNull())
	data.SetModuleVersion(basetypes.NewStringNull())
	if !data.GetModulePath().IsNull() && !data.GetModulePath().IsUnknown() {
		module, err := parseModulesJson(data.GetModulePath().ValueString())
		if err != nil {
			return data
		}
		data.SetModuleSource(types.StringValue(module.Source))
		data.SetModuleVersion(types.StringValue(module.Version))
	}
	return data
}