Change NewAnalysis signature to return a pointer, update occurences accordingly

main
Samuel Maftoul 2021-11-25 17:39:47 +01:00
parent 8d3318725f
commit 572e39170e
2 changed files with 7 additions and 7 deletions

View File

@ -73,8 +73,8 @@ type GenDriftIgnoreOptions struct {
OutputPath string
}
func NewAnalysis(options AnalyzerOptions) Analysis {
return Analysis{options: options}
func NewAnalysis(options AnalyzerOptions) *Analysis {
return &Analysis{options: options}
}
func (a Analysis) MarshalJSON() ([]byte, error) {

View File

@ -109,7 +109,7 @@ func fakeAnalysis(opts analyser.AnalyzerOptions) *analyser.Analysis {
}})
a.ProviderName = "AWS"
a.ProviderVersion = "3.19.0"
return &a
return a
}
func fakeAnalysisWithAlerts() *analyser.Analysis {
@ -196,7 +196,7 @@ func fakeAnalysisWithJsonFields() *analyser.Analysis {
}})
a.ProviderName = "AWS"
a.ProviderVersion = "3.19.0"
return &a
return a
}
func fakeAnalysisWithoutAttrs() *analyser.Analysis {
@ -229,7 +229,7 @@ func fakeAnalysisWithoutAttrs() *analyser.Analysis {
)
a.ProviderName = "AWS"
a.ProviderVersion = "3.19.0"
return &a
return a
}
func fakeAnalysisWithStringerResources() *analyser.Analysis {
@ -298,7 +298,7 @@ func fakeAnalysisWithStringerResources() *analyser.Analysis {
}})
a.ProviderName = "AWS"
a.ProviderVersion = "3.19.0"
return &a
return a
}
func fakeAnalysisWithComputedFields() *analyser.Analysis {
@ -380,7 +380,7 @@ func fakeAnalysisWithComputedFields() *analyser.Analysis {
})
a.ProviderName = "AWS"
a.ProviderVersion = "3.19.0"
return &a
return a
}
func fakeAnalysisWithAWSEnumerationError() *analyser.Analysis {