Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Browser Support #295

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions headerfs/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,18 @@ func TestHeaderStorageFallback(t *testing.T) {
t.Fatalf("error setting new tip: %v", err)
}
for _, header := range newHeaderEntries {
if err := hIndex.truncateIndex(&header.hash, true); err != nil {
// Copy the header hash so we can create a iteration-specific pointer.
// https://github.com/golang/go/discussions/56010#discussion-4441437.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we bump the Go version to 1.22 here, then we can bind the new behavior directly.

hash := header.hash

if err := hIndex.truncateIndex(&hash, true); err != nil {
t.Fatalf("error truncating tip: %v", err)
}
}
for _, header := range oldHeaderEntries {
if err := hIndex.truncateIndex(&header.hash, true); err != nil {
hash := header.hash

if err := hIndex.truncateIndex(&hash, true); err != nil {
t.Fatalf("error truncating tip: %v", err)
}
}
Expand Down