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

Make config loading use a virtual filesystem #2952

Merged
merged 4 commits into from
Nov 14, 2023

Conversation

Tatskaari
Copy link
Member

@Tatskaari Tatskaari commented Nov 14, 2023

This will be useful later on when we allow subrepos to have a filesystem based on the REAPI. We can plug in the remote FS in here so we can resolve config files without downloading the subrepo sources.

Comment on lines +40 to +49
type osFS func(name string) (*os.File, error)

func (r osFS) Open(name string) (iofs.File, error) {
return r(name)
}

// HostFS returns an io/fs.FS that behaves the same as the host OS i.e. the same way os.Open works.
func HostFS() iofs.FS {
return osFS(os.Open)
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why this doesn't exist in the go SDK tbh...

@Tatskaari Tatskaari merged commit b65f754 into thought-machine:master Nov 14, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants