improved ping command

This commit is contained in:
2024-02-20 18:55:37 +01:00
parent f93dbeeab9
commit 62dd8e60f9
3 changed files with 36 additions and 1 deletions

12
main.go
View File

@@ -5,6 +5,8 @@ import (
"log"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"database/sql"
@@ -57,3 +59,13 @@ func main() {
func int64Ptr(i int64) *int64 {
return &i
}
func hexToDecimal(hexColor string) int {
// Remove the hash symbol if it's present
hexColor = strings.TrimPrefix(hexColor, "#")
decimal, err := strconv.ParseInt(hexColor, 16, 64)
if err != nil {
return 0
}
return int(decimal)
}