MCPcopy Create free account
hub / github.com/goccy/go-yaml / encodeMapSlice

Method encodeMapSlice

encode.go:660–670  ·  view source on GitHub ↗
(ctx context.Context, value MapSlice, column int)

Source from the content-addressed store, hash-verified

658}
659
660func (e *Encoder) encodeMapSlice(ctx context.Context, value MapSlice, column int) (*ast.MappingNode, error) {
661 node := ast.Mapping(token.New("", "", e.pos(column)), e.isFlowStyle)
662 for _, item := range value {
663 encoded, err := e.encodeMapItem(ctx, item, column)
664 if err != nil {
665 return nil, err
666 }
667 node.Values = append(node.Values, encoded)
668 }
669 return node, nil
670}
671
672func (e *Encoder) isMapNode(node ast.Node) bool {
673 _, ok := node.(ast.MapNode)

Callers 1

encodeValueMethod · 0.95

Calls 4

posMethod · 0.95
encodeMapItemMethod · 0.95
MappingFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected