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

Function ExampleListBuilder_Prepend

immutable_test.go:615–629  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

613}
614
615func ExampleListBuilder_Prepend() {
616 b := NewListBuilder[string]()
617 b.Prepend("foo")
618 b.Prepend("bar")
619 b.Prepend("baz")
620
621 l := b.List()
622 fmt.Println(l.Get(0))
623 fmt.Println(l.Get(1))
624 fmt.Println(l.Get(2))
625 // Output:
626 // baz
627 // bar
628 // foo
629}
630
631func ExampleListBuilder_Set() {
632 b := NewListBuilder[string]()

Callers

nothing calls this directly

Calls 3

ListMethod · 0.80
PrependMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…