This repository was archived by the owner on Nov 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ func (e *Erf) Fmt() string {
163
163
return e .format
164
164
}
165
165
166
- // Len returns the length of the arguments slice .
166
+ // Len returns the length of arguments.
167
167
func (e * Erf ) Len () int {
168
168
return len (e .args )
169
169
}
@@ -225,6 +225,11 @@ func (e *Erf) Attach2(tags ...string) error {
225
225
return e .Attach (tags ... )
226
226
}
227
227
228
+ // TagsLen returns the length of tags.
229
+ func (e * Erf ) TagsLen () int {
230
+ return len (e .tags )
231
+ }
232
+
228
233
// Tag returns an argument value on the given tag. It returns nil if tag is not found.
229
234
func (e * Erf ) Tag (tag string ) interface {} {
230
235
index := - 1
@@ -247,14 +252,18 @@ func (e *Erf) Tags() []string {
247
252
return result
248
253
}
249
254
250
- // PC returns program counters.
255
+ // PC returns all program counters.
251
256
func (e * Erf ) PC () []uintptr {
252
- src := e .pc [e .top :]
253
- result := make ([]uintptr , len (src ))
254
- copy (result , src )
257
+ result := make ([]uintptr , len (e .pc ))
258
+ copy (result , e .pc )
255
259
return result
256
260
}
257
261
262
+ // PCLen returns the length of all program counters.
263
+ func (e * Erf ) PCLen () int {
264
+ return len (e .pc )
265
+ }
266
+
258
267
// StackTrace returns a StackTrace of Erf.
259
268
func (e * Erf ) StackTrace () * StackTrace {
260
269
return NewStackTrace (e .pc [e .top :]... )
Original file line number Diff line number Diff line change @@ -164,9 +164,6 @@ func (t *StackTrace) Len() int {
164
164
165
165
// Caller returns a StackCaller on the given index. It panics if index is out of range.
166
166
func (t * StackTrace ) Caller (index int ) StackCaller {
167
- if t .Len () <= 0 {
168
- return StackCaller {}
169
- }
170
167
if index < 0 || index >= t .Len () {
171
168
panic ("index out of range" )
172
169
}
You can’t perform that action at this time.
0 commit comments