Skip to content

Commit dc513b2

Browse files
author
Евгений Балякин
committed
fix for tests
1 parent bcc0162 commit dc513b2

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

internal/checks/helpers.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ const (
8585
pgDefault8KBlocks int64 = 8 * 1024
8686
)
8787

88-
func parsePGBytes(raw string) (int64, bool) {
89-
return parsePGBytesWithDefault(raw, pgDefaultBytes)
90-
}
91-
9288
func parsePGBytesWithDefault(raw string, defaultUnitBytes int64) (int64, bool) {
9389
value := strings.TrimSpace(strings.ToLower(raw))
9490
value = strings.Trim(value, `"'`)

internal/detect/kernel.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,7 @@ func normalizePreemption(value string) string {
140140
s = strings.TrimPrefix(s, "preempt_")
141141
s = strings.TrimPrefix(s, "config_preempt_")
142142
s = strings.TrimPrefix(s, "preempt")
143-
if strings.HasPrefix(s, "_") {
144-
s = strings.TrimPrefix(s, "_")
145-
}
143+
s = strings.TrimPrefix(s, "_")
146144
switch s {
147145
case "none":
148146
return "none"

internal/output/pretty.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"sort"
66
"strings"
7+
"unicode"
78

89
"github.com/balyakin/pgkernel/internal/checker"
910
)
@@ -116,10 +117,19 @@ func categoryTitle(category string) string {
116117
case "postgresql":
117118
return "PostgreSQL"
118119
default:
119-
return strings.Title(category)
120+
return upperFirst(category)
120121
}
121122
}
122123

124+
func upperFirst(value string) string {
125+
if value == "" {
126+
return ""
127+
}
128+
runes := []rune(value)
129+
runes[0] = unicode.ToUpper(runes[0])
130+
return string(runes)
131+
}
132+
123133
func statusIcon(status checker.Status) string {
124134
switch status {
125135
case checker.StatusPass:

0 commit comments

Comments
 (0)