Empty Module

Create etc directory with module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module>
    <name>Empty</name>
    <version>1.0.0</version>
</module>

Name is used for defining a name for module and version for versioning.

Create ./config/modules.xml and set module to enabled.

<?xml version="1.0" encoding="UTF-8"?>
<modules>
    <module>
        <name>Empty</name>
        <enabled>true</enabled>
    </module>
</modules>

Create main.go with function called same as name of module which should return module itself and error.

package main

import (
	"github.com/EatherGo/eather"
)

type module struct{}

// Empty to export in plugin
func Empty() (f eather.Module, err error) {
	f = module{}
	return
}

Run your application and you should see this output.

Now your Empty module is running!

Last updated

Was this helpful?