I have 3 files in a project in Go:
Cat.go
package entities
type Cat struct {
Length int
Origin string
Image_link string
Family_friendly int
Shedding int
General_health int
Playfulness int
Children_friendly int
Grooming int
Intelligence int
Other_pets_friendly int
Min_weight int
Max_weight int
Min_life_expectancy int
Max_life_expectancy int
Name string
}
cat.repository.go
package src
import entities "src/domain/entitites"
type CatRepository interface {
ListCats() []entities.Cat
}
cat.repository.impl.go
package repositories
import (
entities "src/domain/entitites"
nir "src/domain/repositories"
)
func (cat entities.Cat) ListCats() []entities.Cat {
}
I am trying to implement interface on third file but compiler says "cannot define new methods on non-local type entitites.Cat"
Someone could tell me how to solve it?