Reputation: 25
how can i do to import a package?
myproject
  main.go
  Repository
            DBHelper.go
  Configuration
            Configuration.go
I need to call a function inside DBHelper.go from Configuration.go, how can i do it?
I need to call Select function from Configuration.go Thanks! Regards!
I Call Select but not working(undefined: DBHelper.Select in DBHelper)
Upvotes: 0
Views: 1904
Reputation: 6433
Package imports are relative from your GOPATH
For example, if DBHelper.go uses package "helpers", your import would look like this:
<name of project folder>/Repository/helpers
Here is a very similar question on the subject: How to use custom packages in Go
--Edit
Almost forgot, to perform the actual function call, you must use the package name / alias.
helpers.MyFunc()
Upvotes: 2