func (pp *primitiveParser) loadStructs() {
	pp.structmap = make(map[string]*ast.StructType)

	for k, o := range pp.p.Scope.Objects {
		// We only care about types
		if o.Kind != ast.Typ {
			continue
		}
		ts, ok := o.Decl.(*ast.TypeSpec)
		if !ok {
			continue
		}

		// and to be more exact, only struct types
		s, ok := ts.Type.(*ast.StructType)
		if !ok {
			continue
		}

		// Empty struct? We don't need to generate and json for it. skip.
		if len(s.Fields.List) == 0 {
			continue
		}

		pp.structmap[k] = s
	}
}
// loadStructs creates a map of name to ast node for struct types from the
// parsed file, filtering out other types.
loadStructs creates a map of name to ast node for struct types from the
parsed file, filtering out other types.
// loadStructs creates a map of name to ast node for struct types from the // parsed file filtering out other types .
func (pp *primitiveParser) loadStructs() {
	pp.structmap = make(map[string]*ast.StructType)
	for k, o := range pp.p.Scope.Objects {
		if o.Kind != ast.Typ {
			continue
		}
		ts, ok := o.Decl.(*ast.TypeSpec)
		if !ok {
			continue
		}
		s, ok := ts.Type.(*ast.StructType)
		if !ok {
			continue
		}
		if len(s.Fields.List) == 0 {
			continue
		}
		pp.structmap[k] = s
	}
}
func ( pp * primitiveParser ) loadStructs ( ) { pp . structmap = make ( map [ string ] * ast . StructType ) for k , o := range pp . p . Scope . Objects { if o . Kind != ast . Typ { continue } ts , ok := o . Decl . ( * ast . TypeSpec ) if ! ok { continue } s , ok := ts . Type . ( * ast . StructType ) if ! ok { continue } if len ( s . Fields . List ) == 0 { continue } pp . structmap [ k ] = s } }
loadStructs creates a map of name to ast node for struct types from the
parsed file, filtering out other types.
loadStructs creates a map of name to ast node for struct types from the parsed file filtering out other types .
// We only care about types // and to be more exact, only struct types // Empty struct? We don't need to generate and json for it. skip.