Example #1
0
func (n *namespace) isTaken(name string) bool {
	if _, ok := n.taken[name]; ok {
		return true
	}
	if n.parent != nil {
		return n.parent.isTaken(name)
	}
	return goast.IsReservedKeyword(name)
}
Example #2
0
func (g *goFileGenerator) isGlobalTaken(name string) bool {
	_, taken := g.globals[name]
	return taken || goast.IsReservedKeyword(name)
}