gitee.com/h79/goutils@v1.22.10/common/result/i18n.go (about)

     1  package result
     2  
     3  type I18n struct {
     4  	Content string
     5  }
     6  
     7  // error interface
     8  func (i18n I18n) Error() string {
     9  	return i18n.Content
    10  }
    11  
    12  func (i18n I18n) Append(content string) I18n {
    13  	i18n.Content += content
    14  	return i18n
    15  }
    16  
    17  func WithI18n(content string) I18n {
    18  	return I18n{Content: content}
    19  }