MCPcopy Create free account
hub / github.com/benbjohnson/immutable / ExampleListBuilder_Append

Function ExampleListBuilder_Append

immutable_test.go:599–613  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597}
598
599func ExampleListBuilder_Append() {
600 b := NewListBuilder[string]()
601 b.Append("foo")
602 b.Append("bar")
603 b.Append("baz")
604
605 l := b.List()
606 fmt.Println(l.Get(0))
607 fmt.Println(l.Get(1))
608 fmt.Println(l.Get(2))
609 // Output:
610 // foo
611 // bar
612 // baz
613}
614
615func ExampleListBuilder_Prepend() {
616 b := NewListBuilder[string]()

Callers

nothing calls this directly

Calls 3

ListMethod · 0.80
AppendMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…