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

Method ToString

lua.go:800–805  ·  view source on GitHub ↗

ToString converts the Lua value at index to a Go string. The Lua value must also be a string or a number; otherwise the function returns false for its second return value. http://www.lua.org/manual/5.2/manual.html#lua_tolstring

(index int)

Source from the content-addressed store, hash-verified

798//
799// http://www.lua.org/manual/5.2/manual.html#lua_tolstring
800func (l *State) ToString(index int) (s string, ok bool) {
801 if s, ok = toString(l.indexToValue(index)); ok { // Bug compatibility: replace a number with its string representation.
802 l.setIndexToValue(index, s)
803 }
804 return
805}
806
807// RawLength returns the length of the value at index. For strings, this is
808// the length. For tables, this is the result of the # operator with no

Callers 15

TestErrorFunction · 0.95
TestErrorfFunction · 0.95
NewStateExFunction · 0.95
TestLoadFileSyntaxErrorFunction · 0.95
debug.goFile · 0.80
ReadMethod · 0.80
base.goFile · 0.80
table.goFile · 0.80
ioFileHelperFunction · 0.80
readLineFunction · 0.80
findFileFunction · 0.80

Calls 3

indexToValueMethod · 0.95
setIndexToValueMethod · 0.95
toStringFunction · 0.85

Tested by 4

TestErrorFunction · 0.76
TestErrorfFunction · 0.76
TestLoadFileSyntaxErrorFunction · 0.76