2013-10-26 22:24:01 -04:00
|
|
|
package engine
|
|
|
|
|
|
|
|
type Hack map[string]interface{}
|
|
|
|
|
2015-03-25 21:40:23 -04:00
|
|
|
func (eng *Engine) HackGetGlobalVar(key string) interface{} {
|
2013-10-26 22:24:01 -04:00
|
|
|
if eng.hack == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
val, exists := eng.hack[key]
|
|
|
|
if !exists {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return val
|
|
|
|
}
|
|
|
|
|
2015-03-25 21:40:23 -04:00
|
|
|
func (eng *Engine) HackSetGlobalVar(key string, val interface{}) {
|
2013-10-26 22:24:01 -04:00
|
|
|
if eng.hack == nil {
|
|
|
|
eng.hack = make(Hack)
|
|
|
|
}
|
|
|
|
eng.hack[key] = val
|
|
|
|
}
|