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 stubs to allow compilation under GOOS=tamago #43

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion osfs/os.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !js
// +build !js,!tamago

// Package osfs provides a billy filesystem for the OS.
package osfs // import "github.com/go-git/go-billy/v5/osfs"
Expand Down
2 changes: 1 addition & 1 deletion osfs/os_posix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build !plan9,!windows,!js
// +build !plan9,!windows,!js,!tamago

package osfs

Expand Down
21 changes: 21 additions & 0 deletions osfs/os_tamago.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// +build tamago

package osfs

import (
"github.com/go-git/go-billy/v5"
"github.com/go-git/go-billy/v5/helper/chroot"
"github.com/go-git/go-billy/v5/memfs"
)

// globalMemFs is the global memory fs
var globalMemFs = memfs.New()

// Default Filesystem representing the root of in-memory filesystem for a
// js/wasm environment.
var Default = memfs.New()

// New returns a new OS filesystem.
func New(baseDir string) billy.Filesystem {
return chroot.New(Default, Default.Join("/", baseDir))
}