Skip to content

Commit

Permalink
add godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
hhatto committed Oct 10, 2021
1 parent 0844dea commit cf020f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions json.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
package gocloc

// JSONLanguagesResult defines the result of the analysis in JSON format
type JSONLanguagesResult struct {
Languages []ClocLanguage `json:"languages"`
Total ClocLanguage `json:"total"`
}

// JSONFilesResult defines the result of the analysis(by files) in JSON format
type JSONFilesResult struct {
Files []ClocFile `json:"files"`
Total ClocLanguage `json:"total"`
}

// NewJSONLanguagesResultFromCloc returns JSONLanguagesResult with default data set
func NewJSONLanguagesResultFromCloc(total *Language, sortedLanguages Languages) JSONLanguagesResult {
var langs []ClocLanguage
for _, language := range sortedLanguages {
Expand All @@ -35,6 +38,7 @@ func NewJSONLanguagesResultFromCloc(total *Language, sortedLanguages Languages)
}
}

// NewJSONFilesResultFromCloc returns JSONFilesResult with default data set
func NewJSONFilesResultFromCloc(total *Language, sortedFiles ClocFiles) JSONFilesResult {
t := ClocLanguage{
FilesCount: total.Total,
Expand Down
2 changes: 2 additions & 0 deletions option.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package gocloc

import "regexp"

// ClocOptions is gocloc processor options
type ClocOptions struct {
Debug bool
SkipDuplicated bool
Expand All @@ -18,6 +19,7 @@ type ClocOptions struct {
OnComment func(line string)
}

// NewClocOptions create new ClocOptions with default values
func NewClocOptions() *ClocOptions {
return &ClocOptions{
Debug: false,
Expand Down

0 comments on commit cf020f3

Please sign in to comment.