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

Function ExampleList_Append

immutable_test.go:507–520  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

505}
506
507func ExampleList_Append() {
508 l := NewList[string]()
509 l = l.Append("foo")
510 l = l.Append("bar")
511 l = l.Append("baz")
512
513 fmt.Println(l.Get(0))
514 fmt.Println(l.Get(1))
515 fmt.Println(l.Get(2))
516 // Output:
517 // foo
518 // bar
519 // baz
520}
521
522func ExampleList_Prepend() {
523 l := NewList[string]()

Callers

nothing calls this directly

Calls 2

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…