MCPcopy Index your code
hub / github.com/tinylib/msgp / getFieldsFromEmbeddedStruct

Method getFieldsFromEmbeddedStruct

parse/getast.go:624–638  ·  view source on GitHub ↗
(f ast.Expr)

Source from the content-addressed store, hash-verified

622}
623
624func (fs *FileSet) getFieldsFromEmbeddedStruct(f ast.Expr) []gen.StructField {
625 switch f := f.(type) {
626 case *ast.Ident:
627 s := fs.Specs[f.Name]
628 switch s := s.(type) {
629 case *ast.StructType:
630 return fs.parseFieldList(s.Fields)
631 default:
632 return nil
633 }
634 default:
635 // other possibilities are disallowed
636 return nil
637 }
638}
639
640// extract embedded field name
641//

Callers 1

getFieldMethod · 0.95

Calls 1

parseFieldListMethod · 0.95

Tested by

no test coverage detected