@@ -90,7 +90,6 @@ func (th *tapeHandler) WithAttrs(attrs []slog.Attr) slog.Handler {
9090
9191 handler := * th
9292 handler .attrs = append (handler .attrs , attrs ... )
93-
9493 return & handler
9594}
9695
@@ -107,7 +106,6 @@ func (th *tapeHandler) WithGroup(name string) slog.Handler {
107106
108107 handler .group = handler .group + name
109108 handler .groups = append (handler .groups , name )
110-
111109 return & handler
112110}
113111
@@ -149,49 +147,42 @@ func (th *tapeHandler) appendKey(bs []byte, group string, key string) []byte {
149147
150148 bs = appendEscapedString (bs , key )
151149 bs = append (bs , keyValueConnector )
152-
153150 return bs
154151}
155152
156153func (th * tapeHandler ) appendBool (bs []byte , value bool ) []byte {
157154 bs = strconv .AppendBool (bs , value )
158155 bs = append (bs , attrConnector ... )
159-
160156 return bs
161157}
162158
163159func (th * tapeHandler ) appendInt64 (bs []byte , value int64 ) []byte {
164160 bs = strconv .AppendInt (bs , value , 10 )
165161 bs = append (bs , attrConnector ... )
166-
167162 return bs
168163}
169164
170165func (th * tapeHandler ) appendUint64 (bs []byte , value uint64 ) []byte {
171166 bs = strconv .AppendUint (bs , value , 10 )
172167 bs = append (bs , attrConnector ... )
173-
174168 return bs
175169}
176170
177171func (th * tapeHandler ) appendFloat64 (bs []byte , value float64 ) []byte {
178172 bs = strconv .AppendFloat (bs , value , 'f' , - 1 , 64 )
179173 bs = append (bs , attrConnector ... )
180-
181174 return bs
182175}
183176
184177func (th * tapeHandler ) appendString (bs []byte , value string ) []byte {
185178 bs = appendEscapedString (bs , value )
186179 bs = append (bs , attrConnector ... )
187-
188180 return bs
189181}
190182
191183func (th * tapeHandler ) appendDuration (bs []byte , value time.Duration ) []byte {
192184 bs = append (bs , value .String ()... )
193185 bs = append (bs , attrConnector ... )
194-
195186 return bs
196187}
197188
@@ -263,38 +254,33 @@ func (th *tapeHandler) appendTime(bs []byte, value time.Time) []byte {
263254
264255 bs = strconv .AppendInt (bs , int64 (mircosecond ), 10 )
265256 bs = append (bs , attrConnector ... )
266-
267257 return bs
268258}
269259
270260func (th * tapeHandler ) appendAny (bs []byte , value any ) []byte {
271261 if err , ok := value .(error ); ok {
272262 bs = append (bs , err .Error ()... )
273263 bs = append (bs , attrConnector ... )
274-
275264 return bs
276265 }
277266
278267 if stringer , ok := value .(fmt.Stringer ); ok {
279268 bs = append (bs , stringer .String ()... )
280269 bs = append (bs , attrConnector ... )
281-
282270 return bs
283271 }
284272
285273 marshaled , err := json .Marshal (value )
286274 if err == nil {
287275 bs = append (bs , marshaled ... )
288276 bs = append (bs , attrConnector ... )
289-
290277 return bs
291278 }
292279
293280 defaults .HandleError ("json.Marshal" , err )
294281
295282 bs = fmt .Appendf (bs , "%+v" , value )
296283 bs = append (bs , attrConnector ... )
297-
298284 return bs
299285}
300286
@@ -317,7 +303,6 @@ func (th *tapeHandler) appendAttr(bs []byte, group string, attr slog.Attr) []byt
317303
318304 if kind == slog .KindGroup {
319305 bs = th .appendAttrs (bs , attr .Key , attr .Value .Group ())
320-
321306 return bs
322307 }
323308
@@ -367,7 +352,6 @@ func (th *tapeHandler) appendSource(bs []byte, pc uintptr) []byte {
367352 bs = append (bs , sourceConnector )
368353 bs = strconv .AppendInt (bs , int64 (frame .Line ), 10 )
369354 bs = append (bs , attrConnector ... )
370-
371355 return bs
372356}
373357
0 commit comments