File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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-
9288func parsePGBytesWithDefault (raw string , defaultUnitBytes int64 ) (int64 , bool ) {
9389 value := strings .TrimSpace (strings .ToLower (raw ))
9490 value = strings .Trim (value , `"'` )
Original file line number Diff line number Diff 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"
Original file line number Diff line number Diff line change 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+
123133func statusIcon (status checker.Status ) string {
124134 switch status {
125135 case checker .StatusPass :
You can’t perform that action at this time.
0 commit comments