You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hi everyone, i'm very new in golang and i can't import a local
package.
I created 2 files :
main.go
--------------------------------------------------
............. package main
............. import (
...................."foo"
............. )
when i build main.go (go build main.go) I get :
main.go:3:2: import "foo": cannot find package
I don't know how to fix that. I do search but i can't find anything
that help me.
Thank you in advance. (Sorry for my english)
Floufen
unread,
Jun 15, 2012, 6:15:00 PM6/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Sorry i miss one thing :
If I try to compile like that : go build i get :
can't load package: package .: found packages foo (foo.go) and main
(main.go) in /home/riad/src
riad@Temple:~/src$
Mathieu Lonjaret
unread,
Jun 15, 2012, 6:27:53 PM6/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Floufen, golang-nuts
since you named your package foo, you need to place foo.go in
/home/riad/src/foo/
and you need to set GOPATH to /home/riad in your case.
go help gopath
will tell you more.
Floufen
unread,
Jun 15, 2012, 6:36:05 PM6/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message