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

Function ExampleListBuilder_Slice

immutable_test.go:645–658  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

643}
644
645func ExampleListBuilder_Slice() {
646 b := NewListBuilder[string]()
647 b.Append("foo")
648 b.Append("bar")
649 b.Append("baz")
650 b.Slice(1, 3)
651
652 l := b.List()
653 fmt.Println(l.Get(0))
654 fmt.Println(l.Get(1))
655 // Output:
656 // bar
657 // baz
658}
659
660// Ensure node can support overwrites as it expands.
661func TestInternal_mapNode_Overwrite(t *testing.T) {

Callers

nothing calls this directly

Calls 4

ListMethod · 0.80
AppendMethod · 0.45
SliceMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…