github.com/arunkumar7540/cli@v6.45.0+incompatible/command/translatableerror/not_logged_in_error.go (about)

     1  package translatableerror
     2  
     3  import "fmt"
     4  
     5  type NotLoggedInError struct {
     6  	BinaryName string
     7  }
     8  
     9  func (NotLoggedInError) Error() string {
    10  	return "Not logged in. Use '{{.CFLoginCommand}}' to log in."
    11  }
    12  
    13  func (e NotLoggedInError) Translate(translate func(string, ...interface{}) string) string {
    14  	return translate(e.Error(), map[string]interface{}{
    15  		"CFLoginCommand": fmt.Sprintf("%s login", e.BinaryName),
    16  	})
    17  }