this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/encoding: remove unused code

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 <rogpeppe@gmail.com>
Change-Id: I398eaf4e3a5233123bfa947803d53485008d0b99
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/549288
TryBot-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Unity-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>

authored by

Roger Peppe and committed by
Daniel Martí
251790ed 36645d1b

-18
-18
internal/encoding/encoding.go
··· 464 464 } 465 465 return ok 466 466 } 467 - 468 - // simplify reformats a File. To be used as a wrapper for Extract functions. 469 - // 470 - // It currently does so by formatting the file using fmt.Format and then 471 - // reparsing it. This is not ideal, but the package format does not provide a 472 - // way to do so differently. 473 - func simplify(f *ast.File, err error) (*ast.File, error) { 474 - if err != nil { 475 - return nil, err 476 - } 477 - // This needs to be a function that modifies f in order to maintain line 478 - // number information. 479 - b, err := format.Node(f, format.Simplify()) 480 - if err != nil { 481 - return nil, err 482 - } 483 - return parser.ParseFile(f.Filename, b, parser.ParseComments) 484 - }