forked from MathieuNls/clever-challenge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
37 lines (32 loc) · 937 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package main
import (
"fmt"
"time"
)
//timeTrack tracks the time it took to do things.
//It's a convenient method that you can use everywhere
//you feel like it
func timeTrack(start time.Time, name string) {
elapsed := time.Since(start)
fmt.Printf("%s took %s\n", name, elapsed)
}
//main is the entry point of our go program. It defers
//the execution of timeTrack so we can know how long it
//took for the main to complete.
//It also calls the compute and output the returned struct
//to stdout.
func main() {
defer timeTrack(time.Now(), "compute diff")
fmt.Println(compute())
}
//compute parses the git diffs in ./diffs and returns
//a result struct that contains all the relevant informations
//about these diffs
// list of files in the diffs
// number of regions
// number of line added
// number of line deleted
// list of function calls seen in the diffs and their number of calls
func compute() *result {
return nil
}