package shell import "sync" type MonoShell struct { sync.Map } var monoShell = &MonoShell{} func Mono(name string) *Shell { v, ok := monoShell.Load(name) if ok { return v.(*Shell) } shell := Base() monoShell.Store(name, shell) return shell }