forked from wildeyedskies/stmp
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathhelpers.go
More file actions
31 lines (25 loc) · 706 Bytes
/
Copy pathhelpers.go
File metadata and controls
31 lines (25 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright 2023 The STMPS Authors
// SPDX-License-Identifier: GPL-3.0-only
package main
import "math"
const (
clientName = "stmps"
clientVersion = "0.9.9"
)
// if the first argument isn't empty, return it, otherwise return the second
func stringOr(firstChoice string, secondChoice string) string {
if firstChoice != "" {
return firstChoice
}
return secondChoice
}
func secondsToMinAndSec(seconds int64) (int, int) {
minutes := math.Floor(float64(seconds) / 60)
remainingSeconds := int(seconds) % 60
return int(minutes), remainingSeconds
}
func iSecondsToMinAndSec(seconds int) (int, int) {
minutes := seconds / 60
remainingSeconds := seconds % 60
return minutes, remainingSeconds
}