Skip to content

Commit

Permalink
Fix longest name length (#90)
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
enr authored and ddollar committed Oct 9, 2016
1 parent 7a6954e commit d42165a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions procfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ func (pf *Procfile) LongestProcessName(concurrency map[string]int) (longest int)
if c, ok := concurrency[entry.Name]; ok {
// Add the number of digits
thisLen += int(math.Log10(float64(c))) + 1
} else {
// The index number after the dot.
thisLen += 1
}
if thisLen > longest {
longest = thisLen
Expand Down

0 comments on commit d42165a

Please sign in to comment.