Skip to content

Commit 3ede579

Browse files
committed
fixed static code check issues
1 parent 467dcea commit 3ede579

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

pkg/notifications/notifier.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,8 @@ func GetDelay(c *cobra.Command, legacyDelay time.Duration) time.Duration {
9595
delay, _ := c.PersistentFlags().GetInt("notifications-delay")
9696
if delay > 0 {
9797
return time.Duration(delay) * time.Second
98-
} else {
99-
return time.Duration(0)
10098
}
99+
return time.Duration(0)
101100
}
102101

103102
// GetTitle returns a common notification title with hostname appended

pkg/notifications/notifier_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ var _ = Describe("notifications", func() {
8282
})
8383
})
8484
When("legacy delay and delay is defined", func() {
85-
It("should use the specified legacy delay", func() {
85+
It("should use the specified legacy delay and ignore the specified delay", func() {
8686
command := cmd.NewRootCommand()
8787
flags.RegisterNotificationFlags(command)
8888

8989
err := command.ParseFlags([]string{
9090
"--notifications-delay",
91-
"5",
91+
"0",
9292
})
9393
Expect(err).NotTo(HaveOccurred())
9494
delay := notifications.GetDelay(command, time.Duration(7)*time.Second)

0 commit comments

Comments
 (0)