mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-23 06:10:48 +01:00
Winni Neessen
fec2f2075a
Modified the build tags to exclude Go 1.20 and above instead of targeting only Go 1.19. This change ensures the code is compatible with future versions of Go by not restricting it to a specific minor version.
22 lines
369 B
Go
22 lines
369 B
Go
// SPDX-FileCopyrightText: 2022-2023 The go-mail Authors
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
//go:build !go1.20
|
|
// +build !go1.20
|
|
|
|
package mail
|
|
|
|
import (
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
// randNum returns a random number with a maximum value of length
|
|
func randNum(maxval int) int {
|
|
if maxval <= 0 {
|
|
return 0
|
|
}
|
|
rand.Seed(time.Now().UnixNano())
|
|
return rand.Intn(maxval)
|
|
}
|