shapes-using-functions

command
v0.0.0-...-a2a1f02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 2 Imported by: 0

README

shapes-using-functions example

Calculating the area and perimeter of circles, rectangles and triangles using functions.

GitHub Webpage

OVERVIEW

This is pretty straight forward using functions. You just call all the different functions,

// Get the shape properties
c1Area := circleArea(c1)
c1Perimeter := circlePerimeter(c1)
r1Area := rectangleArea(r1)
r1Perimeter := rectanglePerimeter(r1)
t1Area := triangleArea(t1)
t1Perimeter := trianglePerimeter(t1)

We will see, we can simplify this using an interface.

RUN

go run shapes-using-functions.go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL