Help us shape the future of Go! Take the 2026 Go Developer Survey

counter

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: AGPL-3.0, Apache-2.0 Imports: 1 Imported by: 0

README

counter

simple mutexed counter for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

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

Counter represents an integer count

func New

func New() *Counter

New returns pointer to Counter struct

func (*Counter) Increment

func (c *Counter) Increment()

Increment increases count by one

func (*Counter) Read

func (c *Counter) Read() int

Read returns current counter value

func (*Counter) Reset

func (c *Counter) Reset()

Reset sets count to zero

Jump to

Keyboard shortcuts

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