-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v0.5: fixed nil dereference for empty autocert config, fixed and simp…
…lified 'error' module, small readme and docs update
- Loading branch information
default
committed
Aug 12, 2024
1 parent
2fc82c3
commit 85fb637
Showing
20 changed files
with
206 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package error | ||
|
||
import "testing" | ||
|
||
func TestBuilder(t *testing.T) { | ||
eb := NewBuilder("error occurred") | ||
eb.Add(Failure("Action 1").With(Invalid("Inner", "1")).With(Invalid("Inner", "2"))) | ||
eb.Add(Failure("Action 2").With(Invalid("Inner", "3"))) | ||
|
||
got := eb.Build().Error() | ||
expected1 := | ||
(`error occurred: | ||
- Action 1 failed: | ||
- invalid Inner - 1 | ||
- invalid Inner - 2 | ||
- Action 2 failed: | ||
- invalid Inner - 3`) | ||
expected2 := | ||
(`error occurred: | ||
- Action 1 failed: | ||
- invalid Inner - 2 | ||
- invalid Inner - 1 | ||
- Action 2 failed: | ||
- invalid Inner - 3`) | ||
if got != expected1 && got != expected2 { | ||
t.Errorf("expected \n%s, got \n%s", expected1, got) | ||
} | ||
} |
Oops, something went wrong.