Last active
April 8, 2018 02:35
-
-
Save SerkanSipahi/0708da19bc3971c0d6689edccd57c4be to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ######################################### | |
// rest/get.go | |
// ######################################### | |
// This is working but its not what i want. | |
func GET(c echo.Context) error { | |
// do something | |
} | |
// This is not working. | |
// Getting following error: cannot use GET (type func(interface {})) as type echo.HandlerFunc in argument to e.GET | |
// I thought i can pass GET function everything when it has a empty interface, what im doing wrong? | |
func GET(c interface{}){ | |
// do something | |
} | |
// maybe im doing everything wrong? | |
// ######################################### | |
// index.go | |
// ######################################### | |
package main | |
import ( | |
"github.com/labstack/echo" | |
"github.com/serkansipahi/bitcollage/rest" | |
) | |
func main() { | |
e := echo.New() | |
e.GET("/*", rest.GET) | |
e.Logger.Fatal(e.Start(":1323")) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@fubarhouse thank you. Now its clearer to me. I think what i want is not possible as you had described.