cli/command: define some consts for repeated values

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2024-10-31 13:03:33 +01:00
parent 2f65cf7d1a
commit 3825d37923
3 changed files with 14 additions and 9 deletions

View File

@ -281,7 +281,8 @@ func (ctx *nodeInspectContext) ResourceNanoCPUs() int {
if ctx.Node.Description.Resources.NanoCPUs == 0 {
return int(0)
}
return int(ctx.Node.Description.Resources.NanoCPUs) / 1e9
const nano = 1e9
return int(ctx.Node.Description.Resources.NanoCPUs) / nano
}
func (ctx *nodeInspectContext) ResourceMemory() string {