Reading environment variables of various types
Go is statically typed. Every variable has a static type, that is, exactly one type known and fixed at compile time. You are not in dynamically typed Python anymore.

You could use reflection, BUT DON'T!


  Common difficulties with
  reflection
  
  If people are new to Go, they shouldn't be using reflection at all.
  
  -rob


Your functions are specializations of os.Getenv. Revise the function names to getenvStr, getenvInt, and getenvBool.


  os.Getenv retrieves the value of the environment variable named
  by the key. It returns the value, which will be empty if the variable
  is not present.


There is often nothing wrong when an environment variable is empty. Instead of panicing, return a named error.

For example,

package main

import (
    "errors"
    "os"
    "strconv"
)

var ErrEnvVarEmpty = errors.New("getenv: environment variable empty")

func getenvStr(key string) (string, error) {
    v := os.Getenv(key)
    if v == "" {
        return v, ErrEnvVarEmpty
    }
    return v, nil
}

func getenvInt(key string) (int, error) {
    s, err := getenvStr(key)
    if err != nil {
        return 0, err
    }
    v, err := strconv.Atoi(s)
    if err != nil {
        return 0, err
    }
    return v, nil
}

func getenvBool(key string) (bool, error) {
    s, err := getenvStr(key)
    if err != nil {
        return false, err
    }
    v, err := strconv.ParseBool(s)
    if err != nil {
        return false, err
    }
    return v, nil
}

func main() {}


References:

Package reflect

The Laws of Reflection