mirror of
https://github.com/siderolabs/talos.git
synced 2025-10-19 19:41:16 +02:00
Minor linter upgrade. Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
20 lines
547 B
Go
20 lines
547 B
Go
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
package nethelpers
|
|
|
|
import (
|
|
"fmt"
|
|
"net"
|
|
)
|
|
|
|
type ints interface {
|
|
~int16 | ~int32 | ~int64 | ~uint16 | ~uint32 | ~uint64 | int | uint
|
|
}
|
|
|
|
// JoinHostPort is a wrapper around net.JoinHostPort which accepts port any integer type.
|
|
func JoinHostPort[T ints](host string, port T) string {
|
|
return net.JoinHostPort(host, fmt.Sprintf("%d", port))
|
|
}
|