v0.5.0-rc4: fixing autocert issue, cache ACME registration, added ls-config option

This commit is contained in:
yusing
2024-09-17 08:41:36 +08:00
parent 04fd6543fd
commit 82f06374f7
33 changed files with 301 additions and 221 deletions

View File

@@ -118,11 +118,11 @@ func (ne NestedError) Subjectf(format string, args ...any) NestedError {
return ne
}
func (ne NestedError) IsNil() bool {
func (ne NestedError) NoError() bool {
return ne.err == nil
}
func (ne NestedError) IsNotNil() bool {
func (ne NestedError) HasError() bool {
return ne.err != nil
}
@@ -139,7 +139,7 @@ func (ne *NestedError) writeToSB(sb *strings.Builder, level int, prefix string)
ne.writeIndents(sb, level)
sb.WriteString(prefix)
if ne.IsNil() {
if ne.NoError() {
sb.WriteString("nil")
return
}

View File

@@ -22,8 +22,8 @@ func TestErrorIs(t *testing.T) {
}
func TestNil(t *testing.T) {
ExpectTrue(t, Nil().IsNil())
ExpectFalse(t, Nil().IsNotNil())
ExpectTrue(t, Nil().NoError())
ExpectFalse(t, Nil().HasError())
ExpectEqual(t, Nil().Error(), "nil")
}