This is an example Go package for implementing geometric shapes.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
James Mills 67325df797
Fix Quick Start example
2 months ago
cmd/shapes Initial Commit 2 months ago
.gitignore Initial Commit 2 months ago
LICENSE Initial Commit 2 months ago
README.md Fix Quick Start example 2 months ago
circle.go Initial Commit 2 months ago
go.mod Initial Commit 2 months ago
rectangle.go Initial Commit 2 months ago
shape.go Initial Commit 2 months ago

README.md

shapes

This is an example Go package for implementing geometric shapes.

Quick Start

package main

import (
    "fmt"

    "git.mills.io/prologic/shapes"
)

var _ shapes.Shape = Triangle{}

type Triangle struct {
    Sides []float64
}

// TODO: Implement me
func (t Triangle) Area() float64 { return 0.0 }

// TODO: Implement me
func (t Triangle) Perimeter() float64 { return 0.0 }

func main() {
    t := Triangle{Sides: []float64{2, 2, 2}}
    fmt.Println(t.Area())
}

License

shapes is licensed under the terms of the MIT License.