traefik / yaegi

Yaegi is Another Elegant Go Interpreter

Home Page:https://pkg.go.dev/github.com/traefik/yaegi

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatically keeping `yaegi extract` generated files up-to-date with `go generate`

karelorigin opened this issue · comments

commented

Proposal

Currently, there's no way to automatically synchronize extracted symbols with their respective dependencies. A go:generate directive, added to the output of Yaegi generated Go files, could help with automating the process. Implementing this feature could make synchronization as simple as calling go generate to regenerate the symbols. Removal will still need to be done manually, however.

Background

I found myself in need of this feature after having written multiple precompiled libraries that need a manual yaegi extract after each API change. This is especially cumbersome for third party dependencies.

Workarounds

The alternative is to write a script that loops over a list of dependencies and calls yaegi extract.