[ 
https://issues.apache.org/jira/browse/YUNIKORN-2051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Peter Bacsko resolved YUNIKORN-2051.
------------------------------------
    Resolution: Fixed

> Fix lint error from staticcheck
> -------------------------------
>
>                 Key: YUNIKORN-2051
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2051
>             Project: Apache YuniKorn
>          Issue Type: Task
>          Components: shim - kubernetes
>            Reporter: PoAn Yang
>            Assignee: PoAn Yang
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.4.0
>
>
> Setup:
> {noformat}
> go install honnef.co/go/tools/cmd/staticcheck@latest
> staticcheck ./...{noformat}
> In yunikorn-k8shim:
> {noformat}
> pkg/admission/conf/am_conf.go:400:6: func parseConfigInt is unused (U1000)
> pkg/admission/webhook_manager.go:72:2: field namespace is unused (U1000)
> pkg/appmgmt/general/general.go:123:9: assigning the result of this type 
> assertion to a variable (switch obj := obj.(type)) could eliminate type 
> assertions in switch cases (S1034)
>     pkg/appmgmt/general/general.go:125:10: could eliminate this type assertion
> pkg/cache/context_test.go:471:2: this value of found is never used (SA4006)
> pkg/cache/task_test.go:31:2: package "k8s.io/apimachinery/pkg/apis/meta/v1" 
> is being imported more than once (ST1019)
>     pkg/cache/task_test.go:32:2: other import of 
> "k8s.io/apimachinery/pkg/apis/meta/v1"
> pkg/cmd/shim/main.go:53:15: type assertion to the same type: 
> serviceContext.RMProxy already has type api.SchedulerAPI (S1040)
> pkg/dispatcher/dispatch_test.go:209:4: should use fmt.Printf instead of 
> fmt.Println(fmt.Sprintf(...)) (but don't forget the newline) (S1038)
> pkg/dispatcher/dispatch_test.go:211:4: should use fmt.Printf instead of 
> fmt.Println(fmt.Sprintf(...)) (but don't forget the newline) (S1038)
> pkg/plugin/scheduler_plugin.go:268:15: type assertion to the same type: 
> serviceContext.RMProxy already has type api.SchedulerAPI (S1040)
> test/e2e/admission_controller/admission_controller_suite_test.go:28:2: 
> package "github.com/onsi/gomega" is being imported more than once (ST1019)
>     test/e2e/admission_controller/admission_controller_suite_test.go:29:2: 
> other import of "github.com/onsi/gomega"
> test/e2e/framework/helpers/common/utils.go:203:15: error strings should not 
> be capitalized (ST1005)
> test/e2e/framework/helpers/k8s/k8s_utils.go:759:99: error should be returned 
> as the last argument (ST1008)
> test/e2e/framework/helpers/yunikorn/rest_api_utils.go:294:14: error strings 
> should not be capitalized (ST1005)
> test/e2e/node_resources/node_resources_suite_test.go:57:5: var kClient is 
> unused (U1000){noformat}
> In yunikorn-core:
> {noformat}
> pkg/common/configs/configvalidator.go:728:6: func ensureDir is unused (U1000)
> pkg/rmproxy/rmproxy.go:412:6: type configurationReloader is unused (U1000)
> pkg/rmproxy/rmproxy.go:417:33: func 
> configurationReloader.DoReloadConfiguration is unused (U1000)
> pkg/scheduler/context_test.go:54:28: func (*mockEventHandler).reset is unused 
> (U1000)
> pkg/scheduler/health_checker.go:36:7: const defaultPeriod is unused (U1000)
> pkg/scheduler/objects/sorters_test.go:409:6: func assertAskList is unused 
> (U1000)
> pkg/scheduler/partition.go:257:29: func (*PartitionContext).isRunning is 
> unused (U1000)
> pkg/scheduler/partition_test.go:1170:2: this value of err is never used 
> (SA4006)
> pkg/webservice/handlers_test.go:258:7: const instType is unused (U1000)
> pkg/webservice/webservice.go:37:5: var lock is unused (U1000)
> pkg/scheduler/tests/operation_test.go:71:19: don't use Yoda conditions 
> (ST1017)
> pkg/scheduler/tests/operation_test.go:199:19: don't use Yoda conditions 
> (ST1017)
> pkg/scheduler/tests/recovery_test.go:74:19: don't use Yoda conditions 
> (ST1017){noformat}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to