mirror of
https://github.com/1f349/violet.git
synced 2024-11-27 22:01:37 +00:00
18 lines
406 B
Go
18 lines
406 B
Go
package utils
|
|
|
|
// Compilable is an interface for structs with an asynchronous compile method.
|
|
type Compilable interface {
|
|
Compile()
|
|
}
|
|
|
|
// MultiCompilable is a slice of multiple Compilable interfaces.
|
|
type MultiCompilable []Compilable
|
|
|
|
// Compile loops over the slice of Compilable interfaces and calls Compile on
|
|
// each one.
|
|
func (m MultiCompilable) Compile() {
|
|
for _, i := range m {
|
|
i.Compile()
|
|
}
|
|
}
|