A type assertion is a method for extracting concrete data from our interface.
Remember, an interface is a layer of decoupling based not on what the concrete data is but what the data can do. There are times you may need to extract some of that data that is stored inside your interface. Go gives you the ability to pull a copy of the concrete data by asking for it. Let's explore this concept and use cases.
--
Access our online courses → https://www.ardanlabs.com/education
Attend a live training → https://www.ardanlabs.com/live-traini...
Other Links:
Website: https://www.ardanlabs.com/
Github: https://github.com/ardanlabs
Twitter: / ardanlabs