MCPcopy Index your code
hub / github.com/Shopify/go-lua / field

Function field

os.go:11–22  ·  view source on GitHub ↗
(l *State, key string, def int)

Source from the content-addressed store, hash-verified

9)
10
11func field(l *State, key string, def int) int {
12 l.Field(-1, key)
13 r, ok := l.ToInteger(-1)
14 if !ok {
15 if def < 0 {
16 Errorf(l, "field '%s' missing in date table", key)
17 }
18 r = def
19 }
20 l.Pop(1)
21 return r
22}
23
24var osLibrary = []RegistryFunction{
25 {"clock", clock},

Callers 1

os.goFile · 0.85

Calls 4

ErrorfFunction · 0.85
FieldMethod · 0.80
ToIntegerMethod · 0.80
PopMethod · 0.80

Tested by

no test coverage detected