File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,12 @@ func (gen *ExplainGenerator) CreateSection(name string) *ExplainGenerator {
39
39
return gen .Sections [name ]
40
40
}
41
41
42
+ func NewExplainGeneratorForError (name string ) * ExplainGenerator {
43
+ return & ExplainGenerator {
44
+ ErrorName : name ,
45
+ }
46
+ }
47
+
42
48
type BugFixSuggestion struct {
43
49
Title string
44
50
Steps []* BugFixStep
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
11
11
func TestExplainGenerator (t * testing.T ) {
12
12
t .Run ("errorName" , func (t * testing.T ) {
13
- gen := & lib.ExplainGenerator { ErrorName : "TestError" }
13
+ gen := lib .NewExplainGeneratorForError ( "TestError" )
14
14
15
15
if gen .ErrorName != "TestError" {
16
16
t .Errorf ("Expected 'TestError', got %s" , gen .ErrorName )
@@ -65,7 +65,7 @@ func TestExplainGenerator(t *testing.T) {
65
65
})
66
66
67
67
t .Run ("Append with newline" , func (t * testing.T ) {
68
- gen := & lib.ExplainGenerator { ErrorName : "TestError" }
68
+ gen := lib .NewExplainGeneratorForError ( "TestError" )
69
69
gen .Add ("This is a simple error explanation.\n " )
70
70
gen .Add ("This is another error message." )
71
71
You can’t perform that action at this time.
0 commit comments