# Interfaces 101 : Implementing Generics with Interfaces Ep. 1

DevFeed: [Interfaces 101 : Implementing Generics with Interfaces Ep. 1](<https://devfeed.tech/articles/interfaces-101-implementing-generics-with-interfaces-ep-1-22197.md>)

Original publisher: [Read original article](<https://www.ardanlabs.com/blog/2023/01/interfaces-101-implementing-generics-with-interfaces.html>)

Published: 2023-01-31T00:00:00Z

Content type: tutorial

Language: en

Sources: [William Kennedy](<https://devfeed.tech/sources/william-kennedy.md>)

Topics: [interfaces](<https://devfeed.tech/topics/interfaces.md>), [Go Language](<https://devfeed.tech/topics/go-language.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [developers](<https://devfeed.tech/tags/developers.md>), [generic-programming](<https://devfeed.tech/tags/generic-programming.md>), [generics](<https://devfeed.tech/tags/generics.md>), [go](<https://devfeed.tech/tags/go.md>), [go-types](<https://devfeed.tech/tags/go-types.md>), [golang](<https://devfeed.tech/tags/golang.md>), [interfaces](<https://devfeed.tech/tags/interfaces.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [polymorphism](<https://devfeed.tech/tags/polymorphism.md>), [series](<https://devfeed.tech/tags/series.md>), [types](<https://devfeed.tech/tags/types.md>), [video](<https://devfeed.tech/tags/video.md>)

## AI overview

A video tutorial explains how Go interfaces can constrain the types accepted by generic functions. It covers defining generic functions, explicitly passing types, and addressing compiler recognition issues while replacing duplicate functions that return different types.

## Source excerpt

Introduction Go interfaces are beneficial to Go developers because they: Allow interfaces to separate mechanism from behavior. Increase flexibility of function parameters. Enable mocking of function parameters. With the addition of generics in Go 1.18, interfaces can be used to constrain the types of values a generic function will accept. To dive deeper into Go interfaces, we invite you to join Miki in his latest series dedicated to Go interfaces.