Skip to content

Commit

Permalink
fix: Check NTP func return
Browse files Browse the repository at this point in the history
  • Loading branch information
kerimkaan committed May 26, 2024
1 parent 374eca8 commit 6a7e576
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 2 additions & 6 deletions cmd/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,7 @@ disk filesystem, interface name, interface hardware address, interface MTU, IPv4
}

// Get NTP configurations from /etc/ntp.conf
ntpConfig, err := helpers.ReadNTPConfFile()
if err != nil {
log.Println(err)
// panic(err)
}
ntpConfig, ntpError := helpers.ReadNTPConfFile()

virtSystem := !(hInfo.VirtualizationSystem == "")
virtName := hInfo.VirtualizationSystem
Expand Down Expand Up @@ -162,7 +158,7 @@ disk filesystem, interface name, interface hardware address, interface MTU, IPv4
}
fmt.Println("DNS Servers: ", resolvConf.Servers)

if *ntpConfig == nil {
if ntpError != nil {
fmt.Println("NTP Configuration is not available")
} else {
for _, ntp := range *ntpConfig {
Expand Down
4 changes: 2 additions & 2 deletions constants/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package constants

const (
// Version is the current version of the application
VERSION = "0.0.4"
VERSION = "0.0.5"
MAJOR = 0
MINOR = 0
PATCH = 4
PATCH = 5
)

0 comments on commit 6a7e576

Please sign in to comment.