mirror of
https://github.com/bcicen/ctop.git
synced 2025-12-06 15:16:41 +08:00
Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <bot@codelingo.io>
This commit is contained in:
@@ -30,7 +30,7 @@ func Get(k string) *Param {
|
||||
return &Param{} // default
|
||||
}
|
||||
|
||||
// Get Param value by key
|
||||
// GetVal gets Param value by key
|
||||
func GetVal(k string) string {
|
||||
return Get(k).Val
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ type Switch struct {
|
||||
Label string
|
||||
}
|
||||
|
||||
// Return Switch by key
|
||||
// GetSwitch returns Switch by key
|
||||
func GetSwitch(k string) *Switch {
|
||||
for _, sw := range GlobalSwitches {
|
||||
if sw.Key == k {
|
||||
@@ -45,7 +45,7 @@ func GetSwitch(k string) *Switch {
|
||||
return &Switch{} // default
|
||||
}
|
||||
|
||||
// Return Switch value by key
|
||||
// GetSwitchVal returns Switch value by key
|
||||
func GetSwitchVal(k string) bool {
|
||||
return GetSwitch(k).Val
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user