Skip to content

Commit 3333934

Browse files
committed
upgrade golangci/golangci-lint-action to v1.54
1 parent cd1f2b1 commit 3333934

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

.github/workflows/static.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
- name: Run linter
1616
uses: golangci/golangci-lint-action@v3
1717
with:
18-
version: v1.51
18+
version: v1.54
1919
args: -E=gofmt,deadcode,unused,varcheck,ineffassign,revive,misspell,exportloopref,asciicheck,bodyclose,depguard,dogsled,dupl,durationcheck,errname,forbidigo -D=staticcheck --timeout=30m0s

.golangci.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
linters-settings:
2+
depguard:
3+
rules:
4+
main:
5+
files:
6+
- $all
7+
- "!$test"
8+
allow:
9+
- $gostd
10+
- k8s.io
11+
- sigs.k8s.io
12+
- github.com

pkg/util/util.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (ac *Azcopy) GetAzcopyJob(dstFileshare string) (AzcopyJobState, string, err
126126
klog.Warningf("failed to get azcopy job with error: %v, jobState: %v", err, AzcopyJobError)
127127
return AzcopyJobError, "", fmt.Errorf("couldn't list jobs in azcopy %v", err)
128128
}
129-
jobid, jobState, err := parseAzcopyJobList(out, dstFileshare)
129+
jobid, jobState, err := parseAzcopyJobList(out)
130130
if err != nil || jobState == AzcopyJobError {
131131
klog.Warningf("failed to get azcopy job with error: %v, jobState: %v", err, jobState)
132132
return AzcopyJobError, "", fmt.Errorf("couldn't parse azcopy job list in azcopy %v", err)
@@ -153,8 +153,8 @@ func (ac *Azcopy) GetAzcopyJob(dstFileshare string) (AzcopyJobState, string, err
153153
return jobState, percent, nil
154154
}
155155

156-
// parseAzcopyJobList parse command azcopy jobs list, get jobid and state from joblist containing dstFileShareName
157-
func parseAzcopyJobList(joblist string, dstFileShareName string) (string, AzcopyJobState, error) {
156+
// parseAzcopyJobList parse command azcopy jobs list, get jobid and state from joblist
157+
func parseAzcopyJobList(joblist string) (string, AzcopyJobState, error) {
158158
jobid := ""
159159
jobSegments := strings.Split(joblist, "JobId: ")
160160
if len(jobSegments) < 2 {

pkg/util/util_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,7 @@ func TestParseAzcopyJobList(t *testing.T) {
222222
}
223223

224224
for _, test := range tests {
225-
dstFileShare := "dstFileShare"
226-
jobid, jobState, err := parseAzcopyJobList(test.str, dstFileShare)
225+
jobid, jobState, err := parseAzcopyJobList(test.str)
227226
if jobid != test.expectedJobid || jobState != test.expectedJobState || !reflect.DeepEqual(err, test.expectedErr) {
228227
t.Errorf("test[%s]: unexpected jobid: %v, jobState: %v, err: %v, expected jobid: %v, jobState: %v, err: %v", test.desc, jobid, jobState, err, test.expectedJobid, test.expectedJobState, test.expectedErr)
229228
}

0 commit comments

Comments
 (0)