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

Function ExampleListBuilder_Set

immutable_test.go:631–643  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

629}
630
631func ExampleListBuilder_Set() {
632 b := NewListBuilder[string]()
633 b.Append("foo")
634 b.Append("bar")
635 b.Set(1, "baz")
636
637 l := b.List()
638 fmt.Println(l.Get(0))
639 fmt.Println(l.Get(1))
640 // Output:
641 // foo
642 // baz
643}
644
645func ExampleListBuilder_Slice() {
646 b := NewListBuilder[string]()

Callers

nothing calls this directly

Calls 4

ListMethod · 0.80
AppendMethod · 0.45
SetMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…