Commit 98955a52 authored by Kyle Clarke's avatar Kyle Clarke 💬

Removed else as per golint recommendation.

parent 5a2f8bc9
Pipeline #5142922 passed with stage
in 33 seconds
......@@ -98,17 +98,17 @@ func DefaultSchedule() *schedule {
func GenerateID(ID ...string) JobID {
if len(ID) > 0 {
return JobID(ID[0])
} else {
unix32bits := uint32(time.Now().UTC().Unix())
b := make([]byte, 12)
numRead, err := rand.Read(b)
if numRead != len(b) || err != nil {
// On return an empty string ID
return JobID("")
}
}
return JobID(fmt.Sprintf("%x%x", unix32bits, b))
unix32bits := uint32(time.Now().UTC().Unix())
b := make([]byte, 12)
numRead, err := rand.Read(b)
if numRead != len(b) || err != nil {
// On return an empty string ID
return JobID("")
}
return JobID(fmt.Sprintf("%x%x", unix32bits, b))
}
// Info will return a populated SchedulesInfo struct.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment