Documentation ¶
Index ¶
- Variables
- type BinManager
- func (m *BinManager) Build(gnoDir string) ([]byte, error)
- func (m *BinManager) Format(gnoFile string) ([]byte, error)
- func (m *BinManager) GnoBin() string
- func (m *BinManager) Lint(doc *store.Document) ([]BuildError, error)
- func (m *BinManager) Precompile(gnoDir string) ([]byte, error)
- func (m *BinManager) RunTest(pkg, name string) ([]byte, error)
- type BuildError
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoGno = errors.New("no gno binary found")
)
Functions ¶
This section is empty.
Types ¶
type BinManager ¶
type BinManager struct {
// contains filtered or unexported fields
}
BinManager is a wrapper for the gno binary and related tooling.
TODO: Should we install / update our own copy of gno?
func NewBinManager ¶
func NewBinManager(gno, gnokey string, precompile, build bool) (*BinManager, error)
NewBinManager returns a new GnoManager.
If the user does not provide a path to the required binaries, we search the user's PATH for them.
`gno`: The path to the `gno` binary. `gnokey`: The path to the `gnokey` binary. `precompile`: Whether to precompile Gno files on save. `build`: Whether to build Gno files on save.
NOTE: Unlike `gnoBin`, `gnokey` is optional.
func (*BinManager) Build ¶
func (m *BinManager) Build(gnoDir string) ([]byte, error)
Build a Gno package: gno build <dir>.
func (*BinManager) Format ¶
func (m *BinManager) Format(gnoFile string) ([]byte, error)
Format a Gno file using std formatter.
TODO: support other tools?
func (*BinManager) GnoBin ¶ added in v0.3.0
func (m *BinManager) GnoBin() string
GnoBin returns the path to the `gno` binary.
This is either user-provided or found on the user's PATH.
func (*BinManager) Lint ¶
func (m *BinManager) Lint(doc *store.Document) ([]BuildError, error)
Lint precompiles and builds a Gno package and returns any errors.
In practice, this means:
1. Precompile the file; 2. build the file; 3. parse the errors; and 4. recompute the offsets (.go -> .gno).
TODO: is this the best way?
func (*BinManager) Precompile ¶
func (m *BinManager) Precompile(gnoDir string) ([]byte, error)
Precompile a Gno package: gno precompile <dir>.