// fieldName assumes that x is the type of an anonymous field and
// returns the corresponding field name. If x is not an acceptable
// anonymous field, the result is nil.
//

fieldName assumes that x is the type of an anonymous field and
returns the corresponding field name. If x is not an acceptable
anonymous field, the result is nil.
// fieldName assumes that x is the type of an anonymous field and // returns the corresponding field name . If x is not an acceptable // anonymous field the result is nil . //
func fieldName(x Expr) *Ident {
	switch t := x.(type) {
	case *Ident:
		return t
	case *SelectorExpr:
		if _, ok := t.X.(*Ident); ok {
			return t.Sel
		}
	case *StarExpr:
		return fieldName(t.X)
	}
	return nil
}
func fieldName ( x Expr ) * Ident { switch t := x . ( type ) { case * Ident : return t case * SelectorExpr : if _ , ok := t . X . ( * Ident ) ; ok { return t . Sel } case * StarExpr : return fieldName ( t . X ) } return nil }
fieldName assumes that x is the type of an anonymous field and
returns the corresponding field name.
fieldName assumes that x is the type of an anonymous field and returns the corresponding field name .