github.com/jenspinney/cli@v6.42.1-0.20190207184520-7450c600020e+incompatible/command/translatableerror/minimum_cli_version_not_met_error.go (about)

     1  package translatableerror
     2  
     3  type MinimumCLIVersionNotMetError struct {
     4  	APIVersion    string
     5  	MinCLIVersion string
     6  	BinaryVersion string
     7  }
     8  
     9  func (e MinimumCLIVersionNotMetError) Error() string {
    10  	return "Cloud Foundry API version {{.APIVersion}} requires CLI version {{.MinCLIVersion}}. You are currently on version {{.BinaryVersion}}. To upgrade your CLI, please visit: https://github.com/cloudfoundry/cli#downloads"
    11  }
    12  
    13  func (e MinimumCLIVersionNotMetError) Translate(translate func(string, ...interface{}) string) string {
    14  	vars := map[string]interface{}{
    15  		"APIVersion":    e.APIVersion,
    16  		"MinCLIVersion": e.MinCLIVersion,
    17  		"BinaryVersion": e.BinaryVersion,
    18  	}
    19  
    20  	return translate(e.Error(), vars)
    21  }