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 |
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 |
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