lang: Pass through the fs and be consistent in usage

This simplifies the API by passing through the filesystem so that
function signatures don't need to be as complicated, and furthermore use
that consistently throughout.
This commit is contained in:
James Shubin
2024-02-21 12:31:31 -05:00
parent a05b6a927e
commit b7efd94147
5 changed files with 37 additions and 33 deletions

View File

@@ -374,10 +374,10 @@ func TestAstFunc1(t *testing.T) {
data := &interfaces.Data{
// TODO: add missing fields here if/when needed
Fs: fs,
FsURI: fs.URI(), // TODO: is this right?
Base: output.Base, // base dir (absolute path) the metadata file is in
Files: output.Files, // no really needed here afaict
Fs: output.FS, // formerly: fs
FsURI: output.FS.URI(), // formerly: fs.URI() // TODO: is this right?
Base: output.Base, // base dir (absolute path) the metadata file is in
Files: output.Files, // no really needed here afaict
Imports: importVertex,
Metadata: output.Metadata,
Modules: "/" + interfaces.ModuleDirectory, // not really needed here afaict
@@ -904,10 +904,10 @@ func TestAstFunc2(t *testing.T) {
data := &interfaces.Data{
// TODO: add missing fields here if/when needed
Fs: fs,
FsURI: "memmapfs:///", // we're in standalone mode
Base: output.Base, // base dir (absolute path) the metadata file is in
Files: output.Files, // no really needed here afaict
Fs: output.FS, // formerly: fs
FsURI: output.FS.URI(),
Base: output.Base, // base dir (absolute path) the metadata file is in
Files: output.Files, // no really needed here afaict
Imports: importVertex,
Metadata: output.Metadata,
Modules: "/" + interfaces.ModuleDirectory, // not really needed here afaict
@@ -1706,10 +1706,10 @@ func TestAstFunc3(t *testing.T) {
data := &interfaces.Data{
// TODO: add missing fields here if/when needed
Fs: fs,
FsURI: "memmapfs:///", // we're in standalone mode
Base: output.Base, // base dir (absolute path) the metadata file is in
Files: output.Files, // no really needed here afaict
Fs: output.FS, // formerly: fs
FsURI: output.FS.URI(),
Base: output.Base, // base dir (absolute path) the metadata file is in
Files: output.Files, // no really needed here afaict
Imports: importVertex,
Metadata: output.Metadata,
Modules: "/" + interfaces.ModuleDirectory, // not really needed here afaict