clock

package
v0.0.0-...-1c03fbe Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2016 License: MIT Imports: 1 Imported by: 0

README

Clock

Implement a clock that handles times without dates.

Create a clock that is independent of date.

You should be able to add and subtract minutes to it.

Two clocks that represent the same time should be equal to each other.

To run the tests simply run the command go test in the exercise directory.

If the test suite contains benchmarks, you can run these with the -bench flag:

go test -bench .

For more detailed info about the Go track see the help page.

Source

Pairing session with Erin Drummond view source

Documentation

Overview

Package clock implements a simple library to handle time without dates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

type Clock struct {
	// contains filtered or unexported fields
}

A Clock represets the clock using the minutes from 0 to 1440 minutos.

func New

func New(hours, minutes int) Clock

Create a new clock representing a clock with hours and minutes.

func (Clock) Add

func (c Clock) Add(minutes int) Clock

Add an quantity of minutes on the clock. Negative numbers will back the clock.

func (Clock) String

func (c Clock) String() string

Return a string representing the actual state of the clock. pattern: hh:mm.

Jump to

Keyboard shortcuts

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