Documentation
¶
Overview ¶
Package tempConv provides conversion among Celsius, Kelvin and Fahrenheit using methods.
Index ¶
Examples ¶
Constants ¶
View Source
const ( // AbsoluteZeroC in celsius AbsoluteZeroC Celsius = -273.15 // FreezingPointC at which water freezes in celsius FreezingPointC Celsius = 0 // BoilingPointC water boils in celsius BoilingPointC Celsius = 100 // AbsoluteZeroF in fahrenheit AbsoluteZeroF Fahrenheit = -459.67 // FreezingPointF in fahrenheit FreezingPointF Fahrenheit = 32 // BoilingPointF water boils in fahrenheit BoilingPointF Fahrenheit = 212 // AbsoluteZeroK in Kelvin AbsoluteZeroK Kelvin = -273.15 // FreezingPointK in Kelvin FreezingPointK Kelvin = 273.15 // BoilingPointK water boils in Kelvin BoilingPointK Kelvin = 373.15 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI wrapper for *flag.FlagSet
func (CLI) DisplayHelp ¶
func (t CLI) DisplayHelp()
DisplayHelp prints help on command line for temperature module
type Celsius ¶
type Celsius float64
Celsius unit for temperature
type Fahrenheit ¶
type Fahrenheit float64
Fahrenheit unit for temperature
func (Fahrenheit) String ¶
func (f Fahrenheit) String() string
String prints in format 100°F value
Can use to print value in %s fmt.Printf format
func (Fahrenheit) ToC ¶
func (f Fahrenheit) ToC() Celsius
ToC converts a Fahrenheit to °C
Example ¶
ExampleFahrenheit_ToC
boilingPointC := BoilingPointF.ToC().String() absoluteZeroC := AbsoluteZeroF.ToC().String() freezingC := FreezingPointF.ToC().String() fmt.Println(boilingPointC) fmt.Println(absoluteZeroC) fmt.Println(freezingC)
Output: 100.00°C -273.15°C 0.00°C
Click to show internal directories.
Click to hide internal directories.