chore: gofmt fix and enable in CI (#414)

* gofmt the files

Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>

* add UT and goFMT to PR Gate (Github Action for PR)

Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>

---------

Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
This commit is contained in:
Peter Pan
2023-05-15 13:53:59 +08:00
committed by GitHub
parent aafe669739
commit e66de8c4ce
4 changed files with 22 additions and 18 deletions

View File

@@ -23,5 +23,9 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- name: Test
run: go test -v ./...
- name: Unit Test
run: make test
- name: Fmt Test
run: fmtFiles=$(make fmt); if [ "$fmtFiles" != "" ];then exit 1; fi

View File

@@ -487,7 +487,7 @@ func TestHPAAnalyzerWithExistingScaleTargetRefWithoutSpecifyingResources(t *test
var errorFound bool
for _, analysis := range analysisResults {
for _, err := range analysis.Error {
if strings.Contains(err.Text, "does not have resource configured."){
if strings.Contains(err.Text, "does not have resource configured.") {
errorFound = true
break
}

View File

@@ -58,7 +58,7 @@ func (NodeAnalyzer) Analyze(a common.Analyzer) ([]common.Result, error) {
}
if len(failures) > 0 {
preAnalysis[node.Name]= common.PreAnalysis{
preAnalysis[node.Name] = common.PreAnalysis{
Node: node,
FailureDetails: failures,
}