MCPcopy Create free account
hub / github.com/aws/smithy-go / newArray

Function newArray

encoding/xml/array.go:29–41  ·  view source on GitHub ↗

newArray returns an array encoder. It also takes in the member start element, array start element. It takes in a isFlattened bool, indicating that an array is flattened array. A wrapped array ["value1", "value2"] is represented as ` value1 value2 `. A fl

(w writer, scratch *[]byte, memberStartElement StartElement, arrayStartElement StartElement, isFlattened bool)

Source from the content-addressed store, hash-verified

27// A flattened array `someList: ["value1", "value2"]` is represented as
28// `<someList>value1</someList><someList>value2</someList>`.
29func newArray(w writer, scratch *[]byte, memberStartElement StartElement, arrayStartElement StartElement, isFlattened bool) *Array {
30 var memberWrapper = memberStartElement
31 if isFlattened {
32 memberWrapper = arrayStartElement
33 }
34
35 return &Array{
36 w: w,
37 scratch: scratch,
38 memberStartElement: memberWrapper,
39 isFlattened: isFlattened,
40 }
41}
42
43// Member adds a new member to the XML array.
44// It returns a Value encoder.

Callers 5

ArrayMethod · 0.70
ArrayWithCustomNameMethod · 0.70
TestWrappedArrayFunction · 0.70
TestFlattenedArrayFunction · 0.70

Calls

no outgoing calls

Tested by 3

TestWrappedArrayFunction · 0.56
TestFlattenedArrayFunction · 0.56