Example #1
0
func (codegen *_CodeGen) Using(compiler *gslang.Compiler, using *ast.Using) {

	nodes := strings.Split(using.Name(), ".")

	_, ok := gslang.FindAnnotation(using.Ref, "gslang.Exception")

	name := using.Name()

	if ok {
		name = strings.Join(nodes[:len(nodes)-1], ".") + "." + exception(nodes[len(nodes)-1])
	}

	codegen.imports[nodes[len(nodes)-1]] = "import " + name
}
Example #2
0
func (codegen *_CodeGen) Using(compiler *gslang.Compiler, using *ast.Using) {

	nodes := strings.Split(using.Name(), ".")

	codegen.imports[nodes[len(nodes)-2]+"."] = strings.Join(nodes[:len(nodes)-1], ".")
}