gometrics

command module
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 7 Imported by: 0

README

GoMetrics

This Go package provides a simple utility to count the total number of lines and functions in .go files within a specified directory. It's useful for getting a quick overview of the size and complexity of a Go project.

Features

  • Counts the total number of lines in .go files.
  • Counts the total number of functions in .go files.
  • Supports counting metrics for all .go files in a specified directory and its subdirectories.

Usage

To use this package, run the main.go file with the path to the directory you want to analyze as an argument. If you want to analyze the current directory, use ..

go run main.go <path>

or

go run main.go .

Installation

You can install GoMetrics by running the following command:

go install github.com/lacolle87/gometrics@v0.5.0

This will install the package and make the gometrics executable available in your $GOPATH/bin directory.

Running the Executable

After installation, you can run the gometrics executable with the desired path:

gometrics <path>

Replace <path> with the path to the directory you want to analyze. If you want to analyze the current directory, use ..

Output

The output will look something like this:

Project Name: myproject
-------------
Lines in main.go: 100; Functions: 20 
Lines in utils.go: 50; Functions: 10
-------------
Total lines: 150; Total functions: 30

Requirements

  • Go 1.23 or later

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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