scream/vendor/src/github.com/layeh/gopher-luar/util.go

16 lines
240 B
Go
Raw Normal View History

2015-10-08 05:42:02 +00:00
package luar
import (
"unicode"
"unicode/utf8"
)
func getExportedName(name string) string {
buf := []byte(name)
first, n := utf8.DecodeRune(buf)
if n == 0 {
return name
}
return string(unicode.ToUpper(first)) + string(buf[n:])
}