code: func detectConfigFileType(path, def string) string {
  	switch ext := filepath.Ext(path); ext {
  	case ".toml":
  		return "toml"
  	case ".yaml", ".yml":
  		return "yaml"
  	case ".json":
  		return "json"
  	default:
  		return def
  	}
  }
docs: // Returns config file type by retrieving extension from the given path.
  // If no corresponding type found, returns the given def as the default value.