mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-15 02:12:55 +01:00
21 lines
344 B
Go
21 lines
344 B
Go
|
// SPDX-FileCopyrightText: 2022-2023 The go-mail Authors
|
||
|
//
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
//go:build go1.20 && !go1.22
|
||
|
// +build go1.20,!go1.22
|
||
|
|
||
|
package mail
|
||
|
|
||
|
import (
|
||
|
"math/rand"
|
||
|
)
|
||
|
|
||
|
// randNum returns a random number with a maximum value of length
|
||
|
func randNum(maxval int) int {
|
||
|
if maxval <= 0 {
|
||
|
return 0
|
||
|
}
|
||
|
return rand.Intn(maxval)
|
||
|
}
|