go-counter

module
Version: v0.0.0-...-4da7b14 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: MIT

README

CircleCI Go Report Card GoDoc license

go-counter

Description

go-counter is a command line program and package for generating frequency distributions. The gocounter command line program supports the following operating systems and architectures.

GOOS GOARCH
darwin amd64
linux amd64
windows amd64
linux arm64

Installation

No installation is required. Just grab a release. You might want to rename your binary to just gocounter (or counter) for convenience.

If you do have go already installed, you can just run using go run main.go or install with make install.

Usage

Go

You can import go-counter as a library with:

import (
  "github.com/spatialcurrent/go-counter/pkg/counter"
)

See counter in GoDoc for information on how to use Go API.

CLI

On the command line use gocounter --help to view usage.

Examples

Go

See the examples in the counter package documentation.

CLI

To print the 10 most frequent lines in a file as a JSON array use:

gocounter top -sejl -n 10 path/to/file

Building

You can build all the released artifacts using make build or run the make target for a specific operating system and architecture.

Testing

To run Go tests use make test (or bash scripts/test.sh), which runs unit tests, go vet, go vet with shadow, errcheck, ineffassign, staticcheck, and misspell.

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

Directories

Path Synopsis
cmd
pkg
counter
Package counter provides functions to generate a frequency histogram of values.
Package counter provides functions to generate a frequency histogram of values.

Jump to

Keyboard shortcuts

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