It's a Go package to convert units of measure.
These instructions will make you have a copy of this package on your machine and import into your program.
Use this command in your Command Line Tool:
go get -u "github.com/lucabarbosa/unitconverter"
This will make a copy of the package in your Go workspace.
Add the following line to your Go file.
import "github.com/lucabarbosa/unitconverter"
This package covers the following units os measure:
- Length
- Inches
- Feets
- Meters
- Temperature
- Celsius
- Fahrenheit
- Kelvin
- Weight
- Kilograms
- Pounds
- Stones
This package allows you to convert each of the measurement units to each other (provided they are in the same category).
This will convert a Meter Length to Feets:
meterLength := unitconverter.Meter(21)
feetLength := unitconverter.MeterToFeet(meterLength)
// output: 68.89763779527559'
This will convert a Celsius Temperature to Kelvin:
celsiusTemperature := unitconverter.Celsius(35)
kelvinTemperature := unitconverter.CelsiusToKelvin(celsiusTemperature)
// output: 308°K
This will convert a Kilogram Wight to Pound:
kilogramWeight := unitconverter.Kilogram(75)
poundWeight := unitconverter.KilogramToPound(kilogramWeight)
// output: 165 lbs
This project is licensed under the MIT License - see the LICENSE.md file for details