github.com/randomtask1155/cli@v6.41.1-0.20181227003417-a98eed78cbde+incompatible/command/translatableerror/interpolation_error.go (about) 1 package translatableerror 2 3 import ( 4 "fmt" 5 "strings" 6 ) 7 8 type InterpolationError struct { 9 Err error 10 } 11 12 func (e InterpolationError) Error() string { 13 return fmt.Sprint(strings.Replace(e.Err.Error(), "\n", ", ", -1)) 14 } 15 16 func (e InterpolationError) Translate(translate func(string, ...interface{}) string) string { 17 return translate(e.Error()) 18 }