Could not compile when using custom context


Hello all,
This question looks similar to
but it is not.

I am new to Go and Echo.
I am trying to do the recipe
Here is my code and error:

package home

import (
	. ""

func Show(c *echo.Context) error {
	cc := c.(*SlovoContext)
	return cc.String(http.StatusOK, "OK")

ant in context.go I have

package controllers

import (

type (
	SlovoContext struct {

In my main.go

//Middleware function to register our context which extends the "echo" one.
func registerContext(h echo.HandlerFunc) echo.HandlerFunc {
	return func(c echo.Context) error {
		cc := &SlovoContext{c}

		return h(cc)

	// Middleware

The error is:

slovo/controllers/home/home.go:10: invalid type assertion: c.(*controllers.SlovoContext) (non-interface type *echo.Context on left)


Hi again,
I found my mistake. The signature of the function was wrong - func Show(c *echo.Context) error.
It had to be func Show(c echo.Context) error.
My function had to accept echo.Context and not a pointer to it, if I understand correctly.