I need to extract some data from the environment variables using Go. This data can be string, boolean or integer, so I ended up writing three functions.package mainimport (    fmt    os    strconv)func getStrEnv(key string) string {    val := os.Getenv(key)    if val ==  {        panic(fmt.Sprintf(some error msg))    }    return val}func getIntEnv(key string) int {    val := getStrEnv(key)    ret, err := strconv.Atoi(val)    if err != nil {        panic(fmt.Sprintf(some error))    }    return ret}func getBoolEnv(key string) bool {    val := getStrEnv(key)    ret, err := strconv.ParseBool(val)    if err != nil {        panic(fmt.Sprintf(some error))    }    return ret}Which works, but in a language like Python, I would just create one function getEnv(key, type_var), which would go through various passes depending on the type_var provided. Is there a way to produce similar result with Go?
Reading environment variables of various types
go