Skip to content

Commit

Permalink
internal/diff: use compact printing mode
Browse files Browse the repository at this point in the history
The default Syntax printing mode is not suitable.
We should print evaluated values.

Change-Id: I810b531f5898fcca049ac8943c5492e558f89ee5
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/6660
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
  • Loading branch information
mpvl committed Jul 26, 2020
1 parent bc76c5f commit 29dd250
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions internal/diff/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"io"

"cuelang.org/go/cue/errors"
"cuelang.org/go/cue/format"
"cuelang.org/go/internal/legacy/cue"
)

Expand Down Expand Up @@ -195,8 +194,8 @@ func (p *printer) printSkipped(n int) {

func (p *printer) printValue(v cue.Value) {
// TODO: have indent option.
b, _ := format.Node(v.Syntax())
p.write(b)
s := fmt.Sprintf("%-v", v)
io.WriteString(p, s)
}

func (p *printer) printFieldRun(es *EditScript, start, end int) {
Expand Down

0 comments on commit 29dd250

Please sign in to comment.