Skip to content

Commit 2109552

Browse files
myitcvflimzy
authored andcommitted
More readable version of hash for debug purposes
1 parent a3e7e93 commit 2109552

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

build/build.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,10 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) {
607607
return nil, fmt.Errorf("could not open %v: %v", binPath, err)
608608
}
609609
defer binFile.Close()
610-
io.Copy(pkgHash, binFile)
610+
611+
binHash := sha256.New()
612+
io.Copy(binHash, binFile)
613+
fmt.Fprintf(pkgHash, "gopherjs bin: %#x\n", binHash.Sum(nil))
611614

612615
orderedBuildTags := append([]string{}, s.options.BuildTags...)
613616
sort.Strings(orderedBuildTags)
@@ -640,7 +643,7 @@ func (s *Session) BuildPackage(pkg *PackageData) (*compiler.Archive, error) {
640643
}
641644

642645
fmt.Fprintf(pkgHash, "import: %v\n", importedPkgPath)
643-
fmt.Fprintf(pkgHash, " hash: %v\n", importedArchive.Hash)
646+
fmt.Fprintf(pkgHash, " hash: %#x\n", importedArchive.Hash)
644647
}
645648

646649
for _, name := range append(pkg.GoFiles, pkg.JSFiles...) {

0 commit comments

Comments
 (0)