Thanks to visit codestin.com
Credit goes to github.com

Skip to content

hello world example panics #1223

@0pcom

Description

@0pcom

Describe the bug

After installing cmd/core and running core setup I attempted to run the basics / hello world example:
https://www.cogentcore.org/core/basics/hello-world
this panics.

How to reproduce

OS: archlinux
Golang: go1.23.0
linux/amd64

Example code

package main

import "cogentcore.org/core/core"

func main() {
	b := core.NewBody()
	core.NewButton(b).SetText("Hello, World!")
	b.RunMainWindow()
}

Relevant output

$ go run main.go
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running, locked to thread]:
cogentcore.org/core/gpu.(*GPU).init(0xc0001b2360)
	/home/user/go/src/github.com/user/project/vendor/cogentcore.org/core/gpu/gpu.go:108 +0x418
cogentcore.org/core/gpu.NewGPU(...)
	/home/user/go/src/github.com/user/project/vendor/cogentcore.org/core/gpu/gpu.go:88
cogentcore.org/core/system/driver/desktop.(*App).InitGPU(0x1dc1240)
/home/user/go/src/github.com/user/project/vendor/cogentcore.org/core/system/driver/desktop/app.go:91 +0x174
cogentcore.org/core/system/driver/desktop.Init()
	/home/user/go/src/github.com/user/project/vendor/cogentcore.org/core/system/driver/desktop/app.go:29 +0x1f
cogentcore.org/core/system/driver.init.0()
	/home/user/go/src/github.com/user/project/vendor/cogentcore.org/core/system/driver/driver_desktop.go:30 +0xb8
exit status 2

Platform

Linux

Metadata

Metadata

Assignees

Labels

bugSomething isn't working correctlyconfirmedThis bug has been confirmed

Type

No type

Projects

Status

In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions