Uploaded image for project: 'Apache YuniKorn'
  1. Apache YuniKorn
  2. YUNIKORN-2183

core: fix goconst linter issues

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core - common

    Description

      Fix existing goconst linter issues:

      pkg/common/security/usergroup_test_resolver.go:43:17: string `testuser1` has 5 occurrences, make it a constant (goconst)
          if userName == "testuser1" {
                         ^
      pkg/common/security/usergroup_test_resolver.go:51:17: string `testuser2` has 3 occurrences, make it a constant (goconst)
          if userName == "testuser2" {
                         ^
      pkg/scheduler/placement/fixed_rule_test.go:141:14: string `root.testparent` has 3 occurrences, make it a constant (goconst)
          if queue != "root.testparent" || err != nil {
                      ^
      pkg/scheduler/placement/filter.go:97:30: string `deny` has 9 occurrences, make it a constant (goconst)
          filter.allow = conf.Type != "deny"
                                      ^
      pkg/scheduler/placement/placement_test.go:127:43: string `test` has 3 occurrences, make it a constant (goconst)
              if parent == nil || parent.getName() != "test" {
                                                      ^
      pkg/scheduler/placement/fixed_rule_test.go:63:10: string `
      partitions:
        - name: default
          queues:
            - name: testqueue
            - name: testparent
              queues:
                - name: testchild
      ` has 3 occurrences, make it a constant (goconst)
          data := `
                  ^
      pkg/scheduler/placement/fixed_rule_test.go:110:14: string `root.testparent.testchild` has 7 occurrences, make it a constant (goconst)
          if queue != "root.testparent.testchild" || err != nil {
                      ^
      pkg/scheduler/placement/filter_test.go:31:14: string `allow` has 10 occurrences, make it a constant (goconst)
          conf.Type = "allow"
                      ^
      pkg/scheduler/placement/filter_test.go:278:17: string `user1` has 4 occurrences, make it a constant (goconst)
          userObj.User = "user1"
                         ^
      pkg/webservice/handlers_test.go:669:13: string `node-1` has 4 occurrences, but such constant `nodeID` already exists (goconst)
          node1ID := "node-1"
                     ^
      pkg/webservice/handlers_test.go:671:13: string `node-2` has 4 occurrences, make it a constant (goconst)
          node2ID := "node-2"
                     ^
      pkg/scheduler/tests/smoke_test.go:620:14: string `root.leaf` has 3 occurrences, make it a constant (goconst)
          leafName := "root.leaf"
                      ^
      pkg/scheduler/tests/reservation_test.go:98:15: string `root.leaf-1` has 5 occurrences, make it a constant (goconst)
          queueName := "root.leaf-1"
                       ^
      pkg/scheduler/tests/smoke_test.go:168:14: string `root.singleleaf` has 3 occurrences, but such constant `leafName` already exists (goconst)
          leafName := "root.singleleaf"
                      ^ 

      Attachments

        Activity

          People

            KatLantyss Chen, Kai-Chun
            wilfreds Wilfred Spiegelenburg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: