(ctx context.Context, value MapSlice, column int)
| 658 | } |
| 659 | |
| 660 | func (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 | |
| 672 | func (e *Encoder) isMapNode(node ast.Node) bool { |
| 673 | _, ok := node.(ast.MapNode) |
no test coverage detected