code: func (opts *ClientOptions) LoadFromEnv(getEnv func(string) string) error {
  	if opts.CacheDir == "" {
  		if v := getEnv(EnvCacheDir); v != "" {
  			if !filepath.IsAbs(v) {
  				return fmt.Errorf("bad %s: not an absolute path - %s", EnvCacheDir, v)
  			}
  			opts.CacheDir = v
  		}
  	}
  	if opts.UserAgent == "" {
  		if v := getEnv(EnvHTTPUserAgentPrefix); v != "" {
  			opts.UserAgent = fmt.Sprintf("%s/%s", v, UserAgent)
  		}
  	}
  	return nil
  }
docs: // LoadFromEnv loads supplied default values from an environment into opts.
  //
  // The supplied getEnv function is used to access named enviornment variables,
  // and should return an empty string if the enviornment variable is not defined.