Skip to content

Commit

Permalink
chore: do not overload standard cap function available in Go
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille committed Jul 17, 2024
1 parent a79e937 commit db67879
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dumper.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ func (d *Dumper) dump(val reflect.Value, ignoreDepth ...bool) {
d.buf.WriteString(__(d.Theme.Func, val.Type().String()))
case reflect.Chan:
d.buf.WriteString(__(d.Theme.Chan, val.Type().String()))
if cap := val.Cap(); cap > 0 {
d.buf.WriteString(__(d.Theme.Chan, fmt.Sprintf("<%d>", cap)))
if vCap := val.Cap(); vCap > 0 {
d.buf.WriteString(__(d.Theme.Chan, fmt.Sprintf("<%d>", vCap)))
}
case reflect.Struct:
d.dumpStruct(val)
Expand Down

0 comments on commit db67879

Please sign in to comment.