Skip to content

Commit c0c38e1

Browse files
authored
Merge pull request #196 from icey-yu/feat-log
fix: add simplify slice type
2 parents 8c683d0 + 6ba25cf commit c0c38e1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

log/simplify.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package log
2+
3+
const (
4+
slicePrintLen = 30
5+
)
6+
7+
type Slice[T any] []T
8+
9+
func (s Slice[T]) Format() any {
10+
if len(s) >= slicePrintLen {
11+
return s[0:slicePrintLen]
12+
}
13+
return s
14+
}

0 commit comments

Comments
 (0)