Handling measurement units in Go APIs - the right way
๐ Overview
This repository demonstrates best practices for representing and working with measurement units in Go APIs. Gone are the days of "is this temperature in Celsius or Fahrenheit?" confusion in your API!
Using this approach, your API can:
โ Accept input values in any compatible unit
โ Internally work with standardized units
โ Return values in just units
โ Provide clear, self-documenting interfaces
๐ ๏ธ Key Dependencies
unitsnet-go - Comprehensive unit conversion library with 100+ unit types
Gleece - Go framework for building APIs from code.