GitHub - gengo/goloc: A tool that counts the number of statements in a Go source file

1 min read Original article ↗

Build Status

Goloc

Goloc is a tool for counting the number of statements in a Go file.

Installation & Usage

To install Goloc, simply run:

go get github.com/gengo/goloc/goloc

This installs goloc locally, and if $GOPATH/bin is in your $PATH, you will now be able to run the goloc command:

$ goloc --help

Goloc is a tool for counting the number of statements in go files.

Usage:

	cat path/to/file | goloc

Goloc reads from stdin, so the easiest is to cat a file and feed it to goloc:

$ cat myfile.go | goloc
20