File tree 2 files changed +11
-13
lines changed
2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -109,6 +109,16 @@ func (a *Application) IsValid() bool {
109
109
return len (a .Problems ) == 0
110
110
}
111
111
112
+ func (a * Application ) RenderProblems () string {
113
+ var problemStrings []string
114
+
115
+ for _ , err := range a .Problems {
116
+ problemStrings = append (problemStrings , fmt .Sprintf ("- %s" , err .Error ()))
117
+ }
118
+
119
+ return strings .Join (problemStrings , "\n " )
120
+ }
121
+
112
122
func (a * Application ) GetData () string {
113
123
data , err := json .MarshalIndent (a , "" , "\t " )
114
124
if err != nil {
Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "fmt"
5
4
"log"
6
- "strings"
7
5
)
8
6
9
7
type Reviewer struct {
@@ -25,21 +23,11 @@ func (r *Reviewer) Review() {
25
23
if r .application .IsValid () {
26
24
debugMessage ("Application has no problems" )
27
25
} else {
28
- debugMessage ("Application problems:" , r .renderProblems ())
26
+ debugMessage ("Application problems:" , r .application . RenderProblems ())
29
27
}
30
28
}
31
29
}
32
30
33
31
func (r * Reviewer ) printErrorAndExit (err error ) {
34
32
log .Fatalf ("Error reviewing issue: %s\n " , err .Error ())
35
33
}
36
-
37
- func (r * Reviewer ) renderProblems () string {
38
- var problemStrings []string
39
-
40
- for _ , err := range r .application .Problems {
41
- problemStrings = append (problemStrings , fmt .Sprintf ("- %s" , err .Error ()))
42
- }
43
-
44
- return strings .Join (problemStrings , "\n " )
45
- }
You can’t perform that action at this time.
0 commit comments