Package leading to undefined variables, not importing correctly, read how to write go code

I read “how to write go code”, and my project is organized

package controllers
package models

Inside the project there are two packages,

models and controllers

When I import I use the” /
" "

However whenever I try to actually use a package in my main.go file I cannot, and it comes up as undefined.

Ex. c:=models.NewController() where NewController() is a function in the models package.

Not sure how to proceed, any help greatly appreciated.

Are you missing the user directory between and your packages?

Ideally it should be


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.