Lorca: invalid memory address or nil pointer dereference

I need an help pleaseeee
I just copied and paste a way to use chrome gui with golang and used the lib Lorca

so why

func getUserName() string {
var envKey string
if runtime.GOOS == “windows” {
envKey = “USERNAME”
} else {
envKey = “USER”
return os.Getenv(envKey)

func main() {
ui, err := lorca.New(“”, “”, 600, 400)

ui.Bind("getUserName", getUserName) <------------------------


throw this error ?
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0xcddbeb]

goroutine 1 [running]:
C:/uga/golang-repo/main.go:27 +0x6b

how can I pass the function to get it worked ?

Thank you in adavance

sounds your ui object is nil , please check why lorca can not be initialized correctly

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.