Skip to content

Latest commit

 

History

History
24 lines (18 loc) · 378 Bytes

File metadata and controls

24 lines (18 loc) · 378 Bytes

Basic counter

package counter

func NewBasicCounter() Counter {
	return &basicCounter{}
}

type basicCounter struct {
	counter int
}

func (s *basicCounter) Inc() int {
	s.counter++
	return s.counter
}

func (s *basicCounter) Count() int {
	return s.counter
}

?