Skip to content

Commit

Permalink
WIP: disable dirhash for the moment
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Penner committed Mar 16, 2024
1 parent abb44bc commit 3a4742e
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions cmd/fetch_repo/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package main
import (
"fmt"
"os"
"golang.org/x/mod/sumdb/dirhash"
)

func fetchModule(dest, importpath, version, sum string) error {
Expand Down Expand Up @@ -61,15 +60,15 @@ func fetchModule(dest, importpath, version, sum string) error {
return fmt.Errorf("failed copying repo: %w", err)
}

// Verify sum
repoSum, err := dirhash.HashDir(dest, importpath+"@"+version, dirhash.Hash1)
if err != nil {
return fmt.Errorf("failed computing sum: %w", err)
}
// // Verify sum
// repoSum, err := dirhash.HashDir(dest, importpath+"@"+version, dirhash.Hash1)
// if err != nil {
// return fmt.Errorf("failed computing sum: %w", err)
// }

if repoSum != sum {
return fmt.Errorf("resulting module with sum %s; expected sum %s", repoSum, sum)
}
// if repoSum != sum {
// return fmt.Errorf("resulting module with sum %s; expected sum %s", repoSum, sum)
// }

return nil
}
Expand Down

0 comments on commit 3a4742e

Please sign in to comment.