git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/timex/max.go (about)

     1  package timex
     2  
     3  import "time"
     4  
     5  func Max(x, y time.Time, times ...time.Time) time.Time {
     6  	max := x
     7  	if y.After(max) {
     8  		max = y
     9  	}
    10  
    11  	for _, t := range times {
    12  		if t.After(max) {
    13  			max = t
    14  		}
    15  	}
    16  
    17  	return max
    18  }