MCPcopy
hub / github.com/duke-git/lancet / ValueOf

Method ValueOf

datastructure/list/list.go:29–34  ·  view source on GitHub ↗

ValueOf return the value pointer at index of list data.

(index int)

Source from the content-addressed store, hash-verified

27
28// ValueOf return the value pointer at index of list data.
29func (l *List[T]) ValueOf(index int) (*T, bool) {
30 if index < 0 || index >= len(l.data) {
31 return nil, false
32 }
33 return &l.data[index], true
34}
35
36// IndexOf returns the index of value. if not found return -1.
37func (l *List[T]) IndexOf(value T) int {

Callers 15

TestRandBytesFunction · 0.45
unsafeInvokeFuncFunction · 0.45
mustBeFunctionFunction · 0.45
TestValueOfFunction · 0.45
sliceValueFunction · 0.45
FlattenFunction · 0.45
getFieldFunction · 0.45
compareRefValueFunction · 0.45
objectsAreEqualValuesFunction · 0.45
cloneMethod · 0.45
ExampleToInterfaceFunction · 0.45

Calls

no outgoing calls

Tested by 5

TestRandBytesFunction · 0.36
TestValueOfFunction · 0.36
ExampleToInterfaceFunction · 0.36
TestToInterfaceFunction · 0.36