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

Custom packages are not found when imported #56

Closed
gopherbot opened this issue Nov 11, 2009 · 3 comments
Closed

Custom packages are not found when imported #56

gopherbot opened this issue Nov 11, 2009 · 3 comments

Comments

@gopherbot
Copy link
Contributor

by astronfo:

Compile any Go source file that imports a custom package (the official 
tutorial at http://golang.org/doc/go_tutorial.html#tmp_164 fails, too)

Instead of the expected output, 8g produces error: "fatal error: can't find 
import: name_of_package". Specifying the include directory with -I does not 
help, either.


$GOOS=linux, $GOARCH=386, revision changeset 3975:b51fd2d6c160

Thanks in advance.
@agl
Copy link
Contributor

agl commented Nov 11, 2009

Comment 1:

You should create a Makefile in the style of the other package Makefiles (see 
src/pkg/crypto/rc4/Makefile) and run `make install`.
(This is more of a mailing list item than a bug if you have follow up questions.)

Status changed to WontFix.

@gopherbot
Copy link
Contributor Author

Comment 2 by tony.landells:

I disagree--it shouldn't require some Makefile magic to have 'import "./file"' import
file.go from the current directory. Particularly, as the original poster mentions,
when you use examples like this in the tutorial.
If it requires some special magic to make it work intuitively there should at least
be a big fat note in the tutorial where you introduce this feature. But honestly,
having to jump through hoops to make (apparently) obvious things work will seriously
impact the uptake of the language.

@gopherbot
Copy link
Contributor Author

Comment 3 by tony.landells:

Okay, so I've finally worked out that import *isn't* like #include--it's more like
linking against a library.
I couldn't find anything about this in the docs, and specifically in the tutorial it
implies that you can just create file.go and reference it with 'import "./file"'
which is pretty misleading.
So the problem doesn't seem to be with import, it seems to be with the documentation.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants