clock

package
v0.0.0-...-f90b8d0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2017 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 https://twitter.com/ebdrummond

Submitting Incomplete Problems

It's possible to submit an incomplete solution so you can see how others have completed the exercise.

Documentation

Overview

implements a simple clock

Index

Constants

View Source
const MINUTES_PER_DAY int = 1440

maximum number of minutes per day

Variables

This section is empty.

Functions

This section is empty.

Types

type Clock

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

a simple clock which keeps time in at most minute precision

func New

func New(hour, minute int) Clock

Creates a new instance of a clock using a specified hour and minute

func (Clock) Add

func (c Clock) Add(minutes int) Clock

Adds some amount of minutes to the clock

func (Clock) String

func (c Clock) String() string

Creates a string representation of the clock

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳