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

Function CheckString

auxiliary.go:317–323  ·  view source on GitHub ↗

CheckString checks whether the function argument at index is a string and returns this string. This function uses ToString to get its result, so all conversions and caveats of that function apply here.

(l *State, index int)

Source from the content-addressed store, hash-verified

315//
316// This function uses ToString to get its result, so all conversions and caveats of that function apply here.
317func CheckString(l *State, index int) string {
318 if s, ok := l.ToString(index); ok {
319 return s
320 }
321 tagError(l, index, TypeString)
322 panic("unreachable")
323}
324
325// OptString returns the string at index if it is a string. If this argument is
326// absent or is nil, returns def. Otherwise, raises an error.

Callers 15

errorMessageMethod · 0.85
debug.goFile · 0.85
base.goFile · 0.85
findHelperFunction · 0.85
formatHelperFunction · 0.85
string.goFile · 0.85
writeFunction · 0.85
io.goFile · 0.85
findLoaderFunction · 0.85
checkLoadFunction · 0.85
searcherLuaFunction · 0.85
searcherPreloadFunction · 0.85

Calls 2

tagErrorFunction · 0.85
ToStringMethod · 0.80

Tested by 1

TestPushFStringPointerFunction · 0.68