From 02e77f41bd3d9eb10d5ad23c4879f2112a17cdc2 Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Wed, 1 Oct 2025 23:18:27 +0100 Subject: [PATCH] First commit with a very simple first function --- README.md | 5 +++++ go.mod | 3 +++ unitconv.go | 7 +++++++ 3 files changed, 15 insertions(+) create mode 100644 README.md create mode 100644 go.mod create mode 100644 unitconv.go diff --git a/README.md b/README.md new file mode 100644 index 0000000..5bdf7e0 --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# UnitConv +Basic package to hold reusable unit conversion operations. + +Used mainly for my simracing projects so that's the scope of the unit conversions I need +here. diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..cf88831 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/ESilva15/unitconv + +go 1.25.1 diff --git a/unitconv.go b/unitconv.go new file mode 100644 index 0000000..9c1ca96 --- /dev/null +++ b/unitconv.go @@ -0,0 +1,7 @@ +// Package unitconv provides useful unit conversions +package unitconv + +// MsToKph converts a float64 representing m/s to an int representing km/h +func MsToKph(v float32) int { + return int(3.6 * v) +}