mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
dedup code
This commit is contained in:
parent
9b7f91c955
commit
91aac5328d
1 changed files with 3 additions and 2 deletions
|
|
@ -411,14 +411,15 @@ func compareHashedFilesets(preHashes map[string]common.Hash, postHashes map[stri
|
||||||
}
|
}
|
||||||
|
|
||||||
func doGoModTidy() {
|
func doGoModTidy() {
|
||||||
preHashes, err := hashSourceFiles([]string{"go.mod", "go.sum"})
|
targetFiles := []string{"go.mod", "go.sum"}
|
||||||
|
preHashes, err := hashSourceFiles(targetFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("failed to hash go.mod/go.sum", "err", err)
|
log.Fatal("failed to hash go.mod/go.sum", "err", err)
|
||||||
}
|
}
|
||||||
tc := new(build.GoToolchain)
|
tc := new(build.GoToolchain)
|
||||||
c := tc.Go("mod", "tidy")
|
c := tc.Go("mod", "tidy")
|
||||||
build.MustRun(c)
|
build.MustRun(c)
|
||||||
postHashes, err := hashSourceFiles([]string{"go.mod", "go.sum"})
|
postHashes, err := hashSourceFiles(targetFiles)
|
||||||
updates := compareHashedFilesets(preHashes, postHashes)
|
updates := compareHashedFilesets(preHashes, postHashes)
|
||||||
for _, updatedFile := range updates {
|
for _, updatedFile := range updates {
|
||||||
fmt.Fprintf(os.Stderr, "changed file %s\n", updatedFile)
|
fmt.Fprintf(os.Stderr, "changed file %s\n", updatedFile)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue