Interfaces Example in Go

If it walks like a duck and it quacks like a duck, then it must be a duck

What’s an interface?

type Reader interface {
Read(p []byte) (n int, err error)
}

--

--

Golang/Python developer. To support me join Medium: https://jerryan.medium.com/membership or Buy me a coffee: https://ko-fi.com/jerryan

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store