You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a good idea to create a set of consistent helper functions that'll make the process of loading entire directories or single files much smoother. These helpers would basically help us create a virtual Module, something we can either find in gno.mod or work out from other clues. These functions could even put together the Module for us, using smart default values.
Presently, gnomod operates in an all-or-nothing fashion – either it works or throws an error. The aim is to refine this behavior. The library or binary utilizing this helper will certainly check for errors, and depending on its needs for an actual file, it might include an extra validation like if mod.FromFile. In most cases, this extra step might not matter, except for potential linting scenarios.
And just to wrap things up, you'd be able to do something like gno test file.gno or cat file.gno | gno test -. This would give you a little pretend world to play with, complete with a package path that's kind of like main or local/r/anonXXXX.
What I'm suggesting is that we develop these helpful functions in gnovm/pkg/gnomod. We could transform the library from just reading files to being the go-to place for getting a gnomod.Module. Reading files would become more like a behind-the-scenes thing that only happens sometimes.
It's a good idea to create a set of consistent helper functions that'll make the process of loading entire directories or single files much smoother. These helpers would basically help us create a virtual
Module
, something we can either find ingno.mod
or work out from other clues. These functions could even put together theModule
for us, using smart default values.Presently,
gnomod
operates in an all-or-nothing fashion – either it works or throws an error. The aim is to refine this behavior. The library or binary utilizing this helper will certainly check for errors, and depending on its needs for an actual file, it might include an extra validation likeif mod.FromFile
. In most cases, this extra step might not matter, except for potential linting scenarios.And just to wrap things up, you'd be able to do something like
gno test file.gno
orcat file.gno | gno test -
. This would give you a little pretend world to play with, complete with a package path that's kind of likemain
orlocal/r/anonXXXX
.What I'm suggesting is that we develop these helpful functions in
gnovm/pkg/gnomod
. We could transform the library from just reading files to being the go-to place for getting agnomod.Module
. Reading files would become more like a behind-the-scenes thing that only happens sometimes.See:
gno test
for_test.gno
and_filetest.gno
files #945 (comment)The text was updated successfully, but these errors were encountered: