Reflection vs. Generics

Let’s compare reflection and generics in Go.

We'll cover the following

In this lesson, we’ll develop a utility that prints the elements of a slice in two ways: first, using reflection, and second, using generics.

Coding example

The code of reflection.go is as follows:

Get hands-on with 1400+ tech skills courses.