fix: bring os_js.go up to date with os.go#192
Open
paralin wants to merge 1 commit intogo-git:mainfrom
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR syncs the GOOS=js implementation of osfs with the non-js osfs API by adding missing options/types (notably WithBoundOS), fixing js/wasm build failures in downstream consumers (e.g., go-git).
Changes:
- Updated
osfs/os_js.goto includeWithBoundOS,WithChrootOS, option plumbing, andBoundOS/ChrootOSimplementations consistent with non-js builds. - Changed js
Defaultto a*ChrootOS(backed by a shared globalmemfs) and expanded the js implementation to support the newer API surface. - Updated/added js tests to reflect the new
Defaulttype and to assertWithBoundOS()returns a*BoundOS.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| osfs/os_js.go | Adds missing js/wasm API parity for WithBoundOS and introduces BoundOS/ChrootOS implementations backed by memfs. |
| osfs/os_js_test.go | Updates Default type expectations and adds a test to ensure WithBoundOS() selects BoundOS. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pjbgf
reviewed
Apr 3, 2026
Contributor
Author
|
@pjbgf comments addressed! |
Recent changes to os_js.go added WithBoundOS and ChrootOSFS. These changes were not propagated to os_js.go, which results in the following build failures in go-git: % GOOS=js GOARCH=wasm gb ./... github.com/go-git/go-git/v6 ./remote.go:214:32: undefined: osfs.WithBoundOS ./repository.go:348:29: undefined: osfs.WithBoundOS ./repository.go:353:28: undefined: osfs.WithBoundOS ./repository.go:460:28: undefined: osfs.WithBoundOS ./repository.go:468:44: undefined: osfs.WithBoundOS ./repository.go:528:32: undefined: osfs.WithBoundOS ./repository.go:531:46: undefined: osfs.WithBoundOS ./repository.go:551:36: undefined: osfs.WithBoundOS ./repository.go:553:62: undefined: osfs.WithBoundOS This commit brings os_js.go up to date with os.go to fix this. All tests pass with GOOS=js GOARCH=wasm now. Signed-off-by: Christian Stewart <christian@aperture.us>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recent changes to os_js.go added WithBoundOS and ChrootOSFS.
These changes were not propagated to os_js.go, which results in the following build failures in go-git:
This commit brings os_js.go up to date with os.go to fix this.
All tests pass with GOOS=js GOARCH=wasm now.