goloc

package module
v0.0.0-...-2176f43 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2014 License: Apache-2.0 Imports: 3 Imported by: 0

README

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

Documentation

Overview

package goloc counts the number of statements in a Go source file

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountStatements

func CountStatements(src string) (int, error)

CountStatements counts the number of statements in a Go source file, given a string representation of the file. It returns an error if the string is not a properly-formatted Go source file.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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