Skip to content

Commit 064cdf4

Browse files
committed
pkg/parsers: deprecate ParseUintListMaximum, ParseUintList
These utilities have been moved internal to pkg/sysinfo in 2282279, and are no longer used. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 3ca5ca4 commit 064cdf4

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

pkg/parsers/parsers.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ func ParseKeyValueOpt(opt string) (key string, value string, err error) {
3434
// 03,1-3 <- this is gonna get parsed as [1,2,3]
3535
// 3,2,1
3636
// 0-2,3,1
37+
//
38+
// Deprecated: ParseUintListMaximum was only used internally and will be removed in the next release.
3739
func ParseUintListMaximum(val string, maximum int) (map[int]bool, error) {
3840
return parseUintList(val, maximum)
3941
}
@@ -52,6 +54,8 @@ func ParseUintListMaximum(val string, maximum int) (map[int]bool, error) {
5254
// 03,1-3 <- this is gonna get parsed as [1,2,3]
5355
// 3,2,1
5456
// 0-2,3,1
57+
//
58+
// Deprecated: ParseUintList was only used internally and will be removed in the next release.
5559
func ParseUintList(val string) (map[int]bool, error) {
5660
return parseUintList(val, 0)
5761
}

pkg/parsers/parsers_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ func TestParseUintList(t *testing.T) {
4545
"0-2,3,1": {0: true, 1: true, 2: true, 3: true},
4646
}
4747
for k, v := range valids {
48-
out, err := ParseUintList(k)
48+
out, err := parseUintList(k, 0)
4949
if err != nil {
5050
t.Fatalf("Expected not to fail, got %v", err)
5151
}
@@ -63,21 +63,21 @@ func TestParseUintList(t *testing.T) {
6363
"-1,0",
6464
}
6565
for _, v := range invalids {
66-
if out, err := ParseUintList(v); err == nil {
66+
if out, err := parseUintList(v, 0); err == nil {
6767
t.Fatalf("Expected failure with %s but got %v", v, out)
6868
}
6969
}
7070
}
7171

7272
func TestParseUintListMaximumLimits(t *testing.T) {
7373
v := "10,1000"
74-
if _, err := ParseUintListMaximum(v, 0); err != nil {
74+
if _, err := parseUintList(v, 0); err != nil {
7575
t.Fatalf("Expected not to fail, got %v", err)
7676
}
77-
if _, err := ParseUintListMaximum(v, 1000); err != nil {
77+
if _, err := parseUintList(v, 1000); err != nil {
7878
t.Fatalf("Expected not to fail, got %v", err)
7979
}
80-
if out, err := ParseUintListMaximum(v, 100); err == nil {
80+
if out, err := parseUintList(v, 100); err == nil {
8181
t.Fatalf("Expected failure with %s but got %v", v, out)
8282
}
8383
}

0 commit comments

Comments
 (0)