Documentation ¶
Overview ¶
Package loc provides functions to calculate lines of code for a Golang project
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileLOC ¶
type FileLOC struct { Package string `json:"package"` // package name File string `json:"file"` // file name LOC int `json:"loc"` // number of lines of code for this file }
FileLOC represents the total lines of code for a specific code file
type PackageLOC ¶
type PackageLOC struct { Package string `json:"package"` // package name LOC int `json:"loc"` // number of lines of code for this package }
PackageLOC represents the total lines of code for a specific package
type ProjectLOC ¶
type ProjectLOC struct { Total int `json:"total"` // number of lines of code for the whole project Packages []PackageLOC `json:"packages"` // detailed information by package Files []FileLOC `json:"files"` // detailed information by file }
ProjectLOC represents the total lines of code for a project
func CountLoc ¶
func CountLoc(prj *project.ProjectInfo) (*ProjectLOC, error)
CountLoc retrieves the Lines of Code metrics for a Golang project. LocMetric contains lines of code aggregated by: file, package and project.
An error is returned when it's not possible to get the packages information
Click to show internal directories.
Click to hide internal directories.