Skip to content

Commit

Permalink
internal/diff: remove unused code
Browse files Browse the repository at this point in the history
When refactoring cue/load, I noticed that some pieces of code
were unused, which makes it less obvious what kinds of things
can be done. I used `staticcheck` to point out many other
places in the code that are unused.

This is one of those places.  I feel it's better to remove this code
even if it might be used in the future (it's always there to be found
in the git history).

Signed-off-by: Roger Peppe <[email protected]>
Change-Id: Id9f42d6ba8f77c9098986a2e72f041f86f0db05b
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549289
Unity-Result: CUEcueckoo <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
Reviewed-by: Daniel Martí <[email protected]>
  • Loading branch information
rogpeppe committed Apr 6, 2023
1 parent aa8c66f commit 9e22283
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
5 changes: 1 addition & 4 deletions internal/diff/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ package diff

import (
"cuelang.org/go/cue"
"cuelang.org/go/cue/errors"
)

// Profile configures a diff operation.
Expand Down Expand Up @@ -165,9 +164,7 @@ func (e Edit) XPos() int { return int(e.xPos - 1) }
func (e Edit) YPos() int { return int(e.yPos - 1) }

type differ struct {
cfg Profile
options []cue.Option
errs errors.Error
cfg Profile
}

func (d *differ) diffValue(x, y cue.Value) (Kind, *EditScript) {
Expand Down
8 changes: 0 additions & 8 deletions internal/diff/print.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,6 @@ func (p *printer) Write(b []byte) (n int, err error) {
return len(b), nil
}

func (p *printer) write(b []byte) {
_, _ = p.Write(b)
}

func (p *printer) printLen(align int, str string) {
fmt.Fprintf(p, "% -[1]*s", align, str)
}

func (p *printer) println(s string) {
fmt.Fprintln(p, s)
}
Expand Down

0 comments on commit 9e22283

Please sign in to comment.