Skip to content

"too many Go files" when importing 2+ files in a subpackage #1022

@SolarLune

Description

@SolarLune

Hello~

I believe it's documented that scriggo.BuildProgram() only can handle one file at the base level of a filesystem. However, I'm finding that this is also the case for all sub packages imported by the main module in descendant directories and built with scriggo.BuildProgram(), which feels a bit tough to work around; not sure if it's a bug?

As an example, here's my layout for the file system being loaded and built with scriggo:

scripts/go.mod - The go.mod file declaring the module being imported
scripts/main.go - Calls `import _ "scripts/gameobjects"`
scripts/gameobjects/player.go
scripts/gameobjects/player2.go -- This second file breaks scriggo's build function

And here's a simple test case:

tooManyGoFilesSubPackages.zip

Maybe this is an extension of issue #521? Maybe because scriggo is internally changing all modules' names to main and executing them, which triggers the "too many Go files" error, even if they are not at the root of the file system?

Metadata

Metadata

Assignees

No one assigned

    Labels

    missing-featureA feature that still needs to be implementedparserRelated to parser

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions