-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: move utility functions to shared package for reuse #49
Copy link
Copy link
Closed
Description
Summary
Useful utility functions scoped locally that could be useful elsewhere.
Current State
truncate()ininternal/cmd/mail/labels.go:125-130formatSize()ininternal/cmd/mail/attachments_list.go:66-77
func truncate(s string, maxLen int) string {
if len(s) <= maxLen {
return s
}
return s[:maxLen-3] + "..."
}
func formatSize(bytes int64) string {
// Converts bytes to human-readable format
}Use Cases
These utilities would be useful for:
- Future Drive integration (file sizes, names)
- Any command that displays truncated text
- Consistent formatting across commands
Proposed Solution
Move to internal/util or internal/format package:
package format
func Truncate(s string, maxLen int) string
func Size(bytes int64) string
func Duration(d time.Duration) stringPriority
P3 - Consider during future feature work (e.g., Drive integration)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels