/golang-interfaces-example

How to compare two different struct functions results in Golang

Primary LanguageGo

Golang Interfaces

This repo shows how interfaces can be used to compare the value of different struct functions.

Problem

We have a Rock struct and Water struct. Both have a Density Function and we need to compare both things.

Solution

Check 2_solution.go

Another example

3_myown.go