@@ -103,7 +103,7 @@ func (e *Error) HasTrait(key Trait) bool {
103103 return false
104104}
105105
106- // IsOfType is a proper type check for an error .
106+ // IsOfType is a proper type check for an errorx-based errors .
107107// It takes the transparency and error types hierarchy into account,
108108// so that type check against any supertype of the original cause passes.
109109func (e * Error ) IsOfType (t * Type ) bool {
@@ -169,12 +169,12 @@ func (e *Error) Format(s fmt.State, verb rune) {
169169 message := e .fullMessage ()
170170 switch verb {
171171 case 'v' :
172- io .WriteString (s , message )
172+ _ , _ = io .WriteString (s , message )
173173 if s .Flag ('+' ) {
174174 e .stackTrace .Format (s , verb )
175175 }
176176 case 's' :
177- io .WriteString (s , message )
177+ _ , _ = io .WriteString (s , message )
178178 }
179179}
180180
@@ -245,29 +245,3 @@ func (e *Error) messageText() string {
245245 }
246246 return message
247247}
248-
249- func joinStringsIfNonEmpty (delimiter string , parts ... string ) string {
250- switch len (parts ) {
251- case 0 :
252- return ""
253- case 1 :
254- return parts [0 ]
255- case 2 :
256- if len (parts [0 ]) == 0 {
257- return parts [1 ]
258- } else if len (parts [1 ]) == 0 {
259- return parts [0 ]
260- } else {
261- return parts [0 ] + delimiter + parts [1 ]
262- }
263- default :
264- filteredParts := make ([]string , 0 , len (parts ))
265- for _ , part := range parts {
266- if len (part ) > 0 {
267- filteredParts = append (filteredParts , part )
268- }
269- }
270-
271- return strings .Join (filteredParts , delimiter )
272- }
273- }
0 commit comments