Skip to content

Commit d42165a

Browse files
enrddollar
authored andcommitted
Fix longest name length (#90)
Hi @ddollar, thanks for your work on Forego. Just an aesthetical issue: there is a wrong alignement when the longest name of processes has length 6. A Procfile: ``` qwerty: echo 'hi' ``` Output with current version: ``` forego | starting qwerty.1 on port 5000 qwerty.1 | hi ``` Output applying this commit: ``` forego | starting qwerty.1 on port 5000 qwerty.1 | hi ```
1 parent 7a6954e commit d42165a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

procfile.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ func (pf *Procfile) LongestProcessName(concurrency map[string]int) (longest int)
4747
if c, ok := concurrency[entry.Name]; ok {
4848
// Add the number of digits
4949
thisLen += int(math.Log10(float64(c))) + 1
50+
} else {
51+
// The index number after the dot.
52+
thisLen += 1
5053
}
5154
if thisLen > longest {
5255
longest = thisLen

0 commit comments

Comments
 (0)