local import "./internal/controller/admin" in non-local package

755 views
Skip to first unread message

zixu mo

unread,
Aug 30, 2015, 9:46:43 PM8/30/15
to golang-nuts
Golang version: 1.5 amd_64
OS: Ubuntu 15.04 x86_64

I am writting project using golang, My $GOPATH   was  $HOME/go
the working directory was $HOME/go/src/netroby/gosense

at the $HOME/go/src/netroby/gosense/main.go






package gosense



import (

 
"fmt"

 
"./internal/controller/admin"

)



func main
() {
   
//Do some code
}



The $HOME/go/src/netroby/gosense/internal/controller/admin/adm
in.go
package admin

import (
   
//import packages ...
)
// some code


while i try to build project

it hang up with result

can't load package: /home/huzhifeng/go/src/netroby/gosense/main.go:4:2: local import
"./internal/controller/admin" in non-local package


I can not resolve this problem by myself.

What doese it means local import "./internal/controller/admin" in non-local package

This project it really my local project. i have no idea how to deal with the local internal import.

James Bardin

unread,
Aug 30, 2015, 10:05:48 PM8/30/15
to golang-nuts


On Sunday, August 30, 2015 at 9:46:43 PM UTC-4, zixu mo wrote:

while i try to build project

it hang up with result

can't load package: /home/huzhifeng/go/src/netroby/gosense/main.go:4:2: local import
"./internal/controller/admin" in non-local package


I can not resolve this problem by myself.

What doese it means local import "./internal/controller/admin" in non-local package


Don't try to use relative imports.
Always import packages by their full import path, e.g.

    import "netroby/gosense/internal/controller/admin"
Reply all
Reply to author
Forward
0 new messages