Skip to content

Instantly share code, notes, and snippets.

@SerkanSipahi
Last active April 8, 2018 02:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SerkanSipahi/0708da19bc3971c0d6689edccd57c4be to your computer and use it in GitHub Desktop.
Save SerkanSipahi/0708da19bc3971c0d6689edccd57c4be to your computer and use it in GitHub Desktop.
// #########################################
// 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"))
}
@fubarhouse
Copy link

All that's left is refer to documentation on usage, and usage does seem to work as recommended.

@SerkanSipahi
Copy link
Author

SerkanSipahi commented Jan 16, 2017

@fubarhouse thank you. Now its clearer to me. I think what i want is not possible as you had described.

func GET(c interface{}){
   
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment