Skip to content

Commit

Permalink
Refactor: extract constant
Browse files Browse the repository at this point in the history
  • Loading branch information
carloscasalar committed Aug 10, 2024
1 parent 4cbcc9f commit 518ac1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/extract-pattern/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ func getColumnExampleWidth(pattern string, nameExamples string) int {
if err != nil {
totalMaxWidth = 80
}
columnExampleMaxWidth := totalMaxWidth - len(pattern) - 10
const paddingsAndColumnsBorderLength = 10
columnExampleMaxWidth := totalMaxWidth - len(pattern) - paddingsAndColumnsBorderLength
columnExampleWidth := min(columnExampleMaxWidth, len(nameExamples))
return columnExampleWidth
}
Expand Down

0 comments on commit 518ac1f

Please sign in to comment.