Skip to content

Commit

Permalink
Fix gocritic findings
Browse files Browse the repository at this point in the history
Fix linter findings.
  • Loading branch information
HeavyWombat committed May 14, 2024
1 parent 73489bf commit 1bcb59e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions internal/cmd/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,8 @@ func retrieveClusterEvents(hvnr havener.Havener) error {
for event := range watcher.ResultChan() {
switch event.Type {
case watch.Added, watch.Modified:
switch event.Object.(type) {
switch data := event.Object.(type) {
case *corev1.Event:
data := *(event.Object.(*corev1.Event))

resourceName := data.Name
if strings.Contains(resourceName, ".") {
parts := strings.Split(resourceName, ".")
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/top.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func renderProgressBar(value int64, max int64, caption string, text string, leng
const symbol = "■"

if !strings.HasSuffix(caption, " ") {
caption = caption + " "
caption += " "
}

if !strings.HasPrefix(text, " ") {
Expand Down
6 changes: 3 additions & 3 deletions internal/cmd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,15 +389,15 @@ func humanReadableDuration(duration time.Duration) string {

if seconds >= 60 {
minutes = seconds / 60
seconds = seconds % 60
seconds %= 60

if minutes >= 60 {
hours = minutes / 60
minutes = minutes % 60
minutes %= 60

if hours >= 24 {
days = hours / 24
hours = hours % 24
hours %= 24
}
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/havener/kubexec.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func (h *Hvnr) PodExec(pod *corev1.Pod, container string, command []string, stdi
}

logf(Verbose, "Successfully executed command.")

return nil
}

Expand Down

0 comments on commit 1bcb59e

Please sign in to comment.