Proposal: Rename repository to "example".
dmitshur opened this issue ยท 6 comments
This repo contains examples of usage, and I'd like it to set the best possible example.
Yet the repo's name is deviating slightly from idiomatic Go naming patterns. It should be singular "example" rather than "examples", so that the import path "example/name-of-example" reads more cleanly, and for consistency.
See https://dmitri.shuralyov.com/idiomatic-go#use-singular-form-for-collection-repo-folder-name for rationale.
If there are no objections, I'd like to rename it to follow idiomatic Go style and set a better example. GitHub will setup redirects from old repo name, so it should be fairly harmless.
No objection.
If there are no objections, I'd like to rename it to follow idiomatic Go style and set a better example. GitHub will setup redirects from old repo name, so it should be fairly harmless.
Just to be clear, we won't allow people to still go get github.com/go-gl/examples
, right? I think it would be a mistake to support two import paths.
That's right. The import paths will be changed to github.com/go-gl/example/...
, and I'll update all instances where they're mentioned in the README.
The supported redirects are just for people visiting the https://github.com/go-gl/examples webpage in their browser.
๐ no objection here as well.
@shurcooL I think we should add import path checking to the example commands as part of this. I can still go get -v github.com/go-gl/examples/...
freely:
$ rm -rf /Users/stephen/Desktop/godev/src/github.com/go-gl/examples/
$ go get -v github.com/go-gl/examples/...
github.com/go-gl/examples (download)
github.com/go-gl/gl (download)
github.com/go-gl/glfw (download)
github.com/go-gl/mathgl (download)
Fetching https://golang.org/x/image/math/f32?go-get=1
Parsing meta tags from https://golang.org/x/image/math/f32?go-get=1 (status code 200)
get "golang.org/x/image/math/f32": found meta tag main.metaImport{Prefix:"golang.org/x/image", VCS:"git", RepoRoot:"https://go.googlesource.com/image"} at https://golang.org/x/image/math/f32?go-get=1
get "golang.org/x/image/math/f32": verifying non-authoritative meta tag
Fetching https://golang.org/x/image?go-get=1
Parsing meta tags from https://golang.org/x/image?go-get=1 (status code 200)
golang.org/x/image (download)
github.com/go-gl/gl/v2.1/gl
github.com/go-gl/glfw/v3.2/glfw
golang.org/x/image/math/f32
github.com/go-gl/gl/v4.1-core/gl
github.com/go-gl/mathgl/mgl32
github.com/go-gl/examples/gl41core-cube
github.com/go-gl/examples/gl21-cube
In effect, we're still supporting both import paths, which IMO is bad.
In effect, we're still supporting both import paths, which IMO is bad.
I don't see that as us supporting both import paths. The old one just happens to work with go get
, but it's not actually supported by us. The actual program won't work, you'll get an error:
2017/05/01 18:41:20 Unable to find Go package in your GOPATH, it's needed to load assets: cannot find package "github.com/go-gl/example/gl41core-cube" in any of:
/usr/local/go/src/github.com/go-gl/example/gl41core-cube (from $GOROOT)
/tmp/gopath/src/github.com/go-gl/example/gl41core-cube (from $GOPATH)
But, I'm okay with adding import comments, then the error will happen at go get
time and maybe it's more clear.
I missed that the program wouldn't work, because I'd already fetched example
into my GOPATH, so it was pulling assets from there despite me running a binary compiled from examples
-- that's one confusing situation that could be avoided with the import path comments :)
PR LGTM