Skip to content

Commit

Permalink
Prettify code
Browse files Browse the repository at this point in the history
  • Loading branch information
simcod committed Sep 12, 2024
1 parent a2faedc commit 8c4f14a
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions cmd/network/ntpdate.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,11 @@ func getTime(log *slog.Logger, servers []string) (t time.Time, err error) {

// NtpDate set the system time to the time coming from a ntp source
func NtpDate(log *slog.Logger, ntpServers []string) {
var (
t time.Time
err error
)

if ntpServers != nil {
t, err = getTime(log, ntpServers)
} else {
t, err = getTime(log, defaultNtpServers)
if ntpServers == nil {
ntpServers = defaultNtpServers
}

t, err := getTime(log, ntpServers)
if err != nil {
log.Error("ntpdate", "unable to get time", err)
}
Expand Down

0 comments on commit 8c4f14a

Please sign in to comment.