mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	refactor: make loader functions for go modules unexported
This commit is contained in:
		
							parent
							
								
									a45b3fe1fa
								
							
						
					
					
						commit
						c46807613e
					
				@ -24,14 +24,14 @@ func New() Bait {
 | 
			
		||||
		Em: emitter,
 | 
			
		||||
	}
 | 
			
		||||
	b.Loader = packagelib.Loader{
 | 
			
		||||
		Load: b.LoaderFunc,
 | 
			
		||||
		Load: b.loaderFunc,
 | 
			
		||||
		Name: "bait",
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return b
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (b *Bait) LoaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
 | 
			
		||||
func (b *Bait) loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
 | 
			
		||||
	exports := map[string]util.LuaExport{
 | 
			
		||||
		"catch": util.LuaExport{b.bcatch, 2, false},
 | 
			
		||||
		"catchOnce": util.LuaExport{b.bcatchOnce, 2, false},
 | 
			
		||||
 | 
			
		||||
@ -18,14 +18,14 @@ func New() Commander {
 | 
			
		||||
		Events: emission.NewEmitter(),
 | 
			
		||||
	}
 | 
			
		||||
	c.Loader = packagelib.Loader{
 | 
			
		||||
		Load: c.LoaderFunc,
 | 
			
		||||
		Load: c.loaderFunc,
 | 
			
		||||
		Name: "commander",
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return c
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (c *Commander) LoaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
 | 
			
		||||
func (c *Commander) loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
 | 
			
		||||
	exports := map[string]util.LuaExport{
 | 
			
		||||
		"register": util.LuaExport{c.cregister, 2, false},
 | 
			
		||||
		"deregister": util.LuaExport{c.cderegister, 1, false},
 | 
			
		||||
 | 
			
		||||
@ -12,11 +12,11 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
var Loader = packagelib.Loader{
 | 
			
		||||
	Load: LoaderFunc,
 | 
			
		||||
	Load: loaderFunc,
 | 
			
		||||
	Name: "fs",
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func LoaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
 | 
			
		||||
func loaderFunc(rtm *rt.Runtime) (rt.Value, func()) {
 | 
			
		||||
	exports := map[string]util.LuaExport{
 | 
			
		||||
		"cd": util.LuaExport{fcd, 1, false},
 | 
			
		||||
		"mkdir": util.LuaExport{fmkdir, 2, false},
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user