How do I connect a function from another directory? #2248
-
Created a project with structure:
Code in
Code in
When running the code via the
Can you please tell me how to get around the error and make it so that I can use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
In the views package you import the "github.com/labstack/echo/v4" package. In main you use e.GET from github.com/labstack/echo/v4, and in the views package you import "github.com/labstack/echo" These are different packages for go, so the echo.Context type in the FCountPrivate definition is different from the Context type used in the HandlerFunc type from the github.com/labstack/echo/v4 package. Response from: https://stackoverflow.com/questions/73427353/how-do-i-connect-a-function-from-another-directory-to-go-echo |
Beta Was this translation helpful? Give feedback.
In the views package you import the "github.com/labstack/echo/v4" package.
In main you use e.GET from github.com/labstack/echo/v4, and in the views package you import "github.com/labstack/echo"
These are different packages for go, so the echo.Context type in the FCountPrivate definition is different from the Context type used in the HandlerFunc type from the github.com/labstack/echo/v4 package.
Response from: https://stackoverflow.com/questions/73427353/how-do-i-connect-a-function-from-another-directory-to-go-echo