I am attempting to create a Golang application. I have one function in my package which I can use fine, the GetCoin
function. However, my function CreateWallet
keeps giving me an error saying it's not defined in the package. The function name is in capitals so it's exported, but it's like my other file can't see it from the import.
Here is the package I am importing:
https://github.com/pocockn/crypto-compare-go/blob/master/handlers/handlers.go
Here is my main file.
import (
"github.com/pocockn/crypto-compare-go/handlers"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
e.Use(middleware.Logger())
e.Use(middleware.Recover())
e.POST("/createWallet", handlers.CreateWallet)
}
There is nothing wrong with the export of the handlers package or CreateWallet.
middleware is not defined, but if you comment out those two lines everything runs fine.
package main
import (
"github.com/pocockn/crypto-compare-go/handlers"
"github.com/labstack/echo"
)
func main() {
e := echo.New()
// e.Use(middleware.Logger())
// e.Use(middleware.Recover())
e.POST("/createWallet", handlers.CreateWallet)
}