code: func expandUser(path string, lookupEnv template.Mapping) string {
  	if strings.HasPrefix(path, "~") {
  		home, ok := lookupEnv("HOME")
  		if !ok {
  			logrus.Warn("cannot expand '~', because the environment lacks HOME")
  			return path
  		}
  		return strings.Replace(path, "~", home, 1)
  	}
  	return path
  }
docs: // TODO: make this more robust