mirror of
https://github.com/moby/buildkit.git
synced 2026-08-04 14:50:21 +00:00
buidlctl: upon error add line number in addition to filename
Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package errdefs
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
@@ -63,6 +63,7 @@ func (s *Source) Print(w io.Writer) error {
|
||||
}
|
||||
var p int
|
||||
|
||||
prepadStart := start
|
||||
for {
|
||||
if p >= pad {
|
||||
break
|
||||
@@ -78,7 +79,7 @@ func (s *Source) Print(w io.Writer) error {
|
||||
p++
|
||||
}
|
||||
|
||||
fmt.Fprintf(w, "%s\n--------------------\n", s.Filename)
|
||||
fmt.Fprintf(w, "%s:%d\n--------------------\n", s.Filename, prepadStart)
|
||||
for i := start; i <= end; i++ {
|
||||
pfx := " "
|
||||
if containsLine(s.Locations, i) {
|
||||
|
||||
Reference in New Issue
Block a user