MCPcopy Create free account
hub / github.com/mmcgrana/gobyexample / geometry

Interface geometry

examples/interfaces/interfaces.go:12–15  ·  view source on GitHub ↗

Here's a basic interface for geometric shapes.

Source from the content-addressed store, hash-verified

10
11// Here's a basic interface for geometric shapes.
12type geometry interface {
13 area() float64
14 perim() float64
15}
16
17// For our example we'll implement this interface on
18// `rect` and `circle` types.

Callers 4

mainFunction · 0.65
measureFunction · 0.65
mainFunction · 0.65
measureFunction · 0.65

Implementers 3

rectexamples/methods/methods.go
rectexamples/interfaces/interfaces.go
circleexamples/interfaces/interfaces.go

Calls

no outgoing calls

Tested by

no test coverage detected