mirror of
https://github.com/moby/moby.git
synced 2026-08-08 17:11:38 +00:00
full diff: https://github.com/moby/buildkit/compare/d1e5d1a8f771...v0.27.0-rc1 Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
29 lines
761 B
Go
29 lines
761 B
Go
// SPDX-FileCopyrightText: Copyright 2015-2025 go-swagger maintainers
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package conv
|
|
|
|
import (
|
|
"strconv"
|
|
)
|
|
|
|
// FormatInteger turns an integer type into a string.
|
|
func FormatInteger[T Signed](value T) string {
|
|
return strconv.FormatInt(int64(value), 10)
|
|
}
|
|
|
|
// FormatUinteger turns an unsigned integer type into a string.
|
|
func FormatUinteger[T Unsigned](value T) string {
|
|
return strconv.FormatUint(uint64(value), 10)
|
|
}
|
|
|
|
// FormatFloat turns a floating point numerical value into a string.
|
|
func FormatFloat[T Float](value T) string {
|
|
return strconv.FormatFloat(float64(value), 'f', -1, bitsize(value))
|
|
}
|
|
|
|
// FormatBool turns a boolean into a string.
|
|
func FormatBool(value bool) string {
|
|
return strconv.FormatBool(value)
|
|
}
|