Skip to content

Foxcapades/tally-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple Counters

GitHub tag (latest SemVer) GitHub go.mod Go version GitHub api docs ff69b4 Go badge

A set of counters for each of the standard Go integer types.

package main

import (
  "fmt"
  "github.com/foxcapades/tally-go/v1/tally"
)

func main() {
  // create a new int8 tally wrapping a starting value of 5
  count := tally.ITally8(5)

  fmt.Println(count.Inc())   // 5
  fmt.Println(count.Dec())   // 6
  fmt.Println(count.Add(15)) // 5
  fmt.Println(count.Sub(10)) // 20
  fmt.Println(count.Zero())  // 10
  fmt.Println(count.Cur())   // 0
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published