Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go run fails #85

Open
hajimehoshi opened this issue Nov 3, 2024 · 1 comment
Open

go run fails #85

hajimehoshi opened this issue Nov 3, 2024 · 1 comment

Comments

@hajimehoshi
Copy link
Member

% go version
go version go1.23.1 darwin/arm64

% go run github.com/go-gl/example/gl21-cube@latest
2024/11/04 05:07:23 Unable to find Go package in your GOPATH, it's needed to load assets: no required module provides package github.com/go-gl/example/gl21-cube: go.mod file not found in current directory or any parent directory; see 'go help modules'
exit status 1

Cloning this repository and running go run ./gl21-cube worked.

@dmitshur
Copy link
Member

dmitshur commented Nov 3, 2024

Thanks for reporting. The example program should use go:embed and embed the assets into the binary to fix this.

dmitshur added a commit that referenced this issue Nov 3, 2024
This makes the result binary more portable. It can be copied to another
machine where the source code isn't present and still run okay. Relying
on the go/build package and GOPATH to find assets was the best we could
do before the module mode.

Fixes #85.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants