package main
import (
“bufio”
“fmt”
“os”
“strconv”
)
// aliasing type
type Celsius float32
type Fahrenheit float32
func main() {
reader := bufio.NewReader(os.Stdin)
t, _ := reader.ReadString(’\n’)
//fmt.Println(toFahrenheit(strconv.ParseFloat(t)))
value, err := strconv.ParseFloat(t, 32)
if err == nil {
fmt.Println(toFahrenheit(Celsius(value)))
}
}
// Function to convert celsius to fahrenheit
func toFahrenheit(t Celsius) Fahrenheit {
//var temp Fahrenheit
temp := Fahrenheit((t * 9 / 5) + 32)
return temp
}
when running this program , it timesout. I am very new to GO . Please suggest