示例#1
0
文件: codegen.go 项目: gsrpc/gsrpc
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
}
示例#2
0
文件: codegen.go 项目: gsrpc/gsrpc
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], ".")
}