Skip to content

Commit 1d44dd3

Browse files
committed
Change return and remove count in makeYAML
1 parent 5519eb3 commit 1d44dd3

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test-crawler/main.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func main() {
3030
config := NewConfig()
3131

3232
crawlRepoBehaviorsAndSaveToJSON(config)
33+
3334
}
3435

3536
func crawlRepoBehaviorsAndSaveToJSON(config Config) {
@@ -105,20 +106,18 @@ func extractPublicMethodsFromFile(ctx context.Context, filePath string) ([]c.Fun
105106
}
106107

107108
// makeYAML will make yaml file from public methods.
108-
func makeYAML(ctx context.Context, filePath string) ([]byte, error) {
109+
func makeYAML(ctx context.Context, filePath string) error {
109110

110111
publicMethods, err := extractPublicMethodsFromFile(ctx, filePath)
111112
if err != nil {
112113
fmt.Print(err)
113114
os.Exit(1)
114115
}
115116

116-
var count int
117-
for _, fn := range publicMethods {
118-
count++
119-
fn.ID = count
117+
for i, fn := range publicMethods {
118+
i++
119+
fn.ID = i
120120
publicMethods = append(publicMethods[1:], fn)
121-
122121
}
123122

124123
yamlData, err := y.Marshal(&publicMethods)
@@ -131,7 +130,7 @@ func makeYAML(ctx context.Context, filePath string) ([]byte, error) {
131130
if err != nil {
132131
panic("Unable to write data into the file")
133132
}
134-
return yamlData, nil
133+
return nil
135134
}
136135

137136
func linkFiles(flist []c.Function) (links [][]FnLink) {

0 commit comments

Comments
 (0)