1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/compiler/tests/project_with_modules_having_submodules
2020-03-01 15:49:39 +01:00
..
bin compiler: import modules relative to v.mod 2020-03-01 15:49:39 +01:00
mod1 compiler: import modules relative to v.mod 2020-03-01 15:49:39 +01:00
tests compiler: import modules relative to v.mod 2020-03-01 15:49:39 +01:00
.gitignore compiler: import modules relative to v.mod 2020-03-01 15:49:39 +01:00
README.md compiler: import modules relative to v.mod 2020-03-01 15:49:39 +01:00
v.mod compiler: import modules relative to v.mod 2020-03-01 15:49:39 +01:00

This projects demonstrates how v.mod lookup can be used so that a project/module can be as selfcontained as possible.

The programs under bin/ can find the modules mod1, because the project has a 'v.mod' file, so v module lookup for the programs under bin/ can still find the parent sibling folder mod1/ through relation to the parent 'v.mod' file.

Note also that mod1/ also has its own 'v.mod' file. This allows mod1 submodules to find and import themselves in relation to it too.

Finally, there is a test/ folder, so you can put all your tests in there, without cluttering your top level folder, or your module folders if you so desire.