accumulator

package
v0.0.0-...-9413c1f Latest Latest
Warning

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

Go to latest
Published: May 15, 2015 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package accumulator provides an integer wrapper with a pointer receiver method to sum results of Read, ReadFrom, Write and WriteTo signatures.

Usage:

var a accumulator.Int64
defer func() {
	if r := recover(); r != nil {
		err, _ = r.(error)
	}
	n = int64(a)
}()

a.Accumulate(w.Write(b1))
a.Accumulate(w.Write(b2))
a.Accumulate(w.Write(b3))
a.Accumulate(w.Write(b1))
a.Accumulate64(w.ReadFrom(r))
...
fmt.Println("wrote:", a)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Int64

type Int64 int64

func (*Int64) Accumulate

func (a *Int64) Accumulate(i int, err error)

Accumulate Read and Write results with panic on error.

func (*Int64) Accumulate64

func (a *Int64) Accumulate64(i int64, err error)

Accumulate64 ReadFrom and WriteTo results with panic on error.

func (*Int64) String

func (a *Int64) String() string

Jump to

Keyboard shortcuts

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