all: apply modernisers
Test / Create distribution (push) Successful in 58s
Test / Sandbox (push) Successful in 2m48s
Test / ShareFS (push) Successful in 3m53s
Test / Hakurei (push) Successful in 4m0s
Test / Sandbox (race detector) (push) Successful in 5m37s
Test / Hakurei (race detector) (push) Successful in 6m40s
Test / Flake checks (push) Successful in 1m12s

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-06-08 14:19:11 +09:00
parent 725f2e0ef3
commit f869ff95a1
35 changed files with 146 additions and 141 deletions
+21 -15
View File
@@ -238,8 +238,8 @@ func (t *TContext) destroy(errP *error) {
if chmodErr != nil || removeErr != nil {
*errP = errors.Join(*errP, chmodErr, removeErr)
} else if errors.Is(*errP, os.ErrExist) {
var linkError *os.LinkError
if errors.As(*errP, &linkError) && linkError != nil &&
if linkError, ok := errors.AsType[*os.LinkError](*errP); ok &&
linkError != nil &&
linkError.Op == "rename" {
// two artifacts may be backed by the same file
*errP = nil
@@ -974,36 +974,42 @@ func (e *ScrubError) Unwrap() []error {
// Error returns a multi-line representation of [ScrubError].
func (e *ScrubError) Error() string {
var segments []string
var buf strings.Builder
if len(e.ChecksumMismatches) > 0 {
s := "checksum mismatches:\n"
buf.Reset()
buf.WriteString("checksum mismatches:\n")
for _, m := range e.ChecksumMismatches {
s += m.Error() + "\n"
buf.WriteString(m.Error() + "\n")
}
segments = append(segments, s)
segments = append(segments, buf.String())
}
if len(e.DanglingIdentifiers) > 0 {
s := "dangling identifiers:\n"
buf.Reset()
buf.WriteString("dangling identifiers:\n")
for _, id := range e.DanglingIdentifiers {
s += Encode(id) + "\n"
buf.WriteString(Encode(id) + "\n")
}
segments = append(segments, s)
segments = append(segments, buf.String())
}
if len(e.DanglingStatus) > 0 {
s := "dangling status:\n"
buf.Reset()
buf.WriteString("dangling status:\n")
for _, id := range e.DanglingStatus {
s += Encode(id) + "\n"
buf.WriteString(Encode(id) + "\n")
}
segments = append(segments, s)
segments = append(segments, buf.String())
}
if len(e.Errs) > 0 {
s := "errors during scrub:\n"
buf.Reset()
buf.WriteString("errors during scrub:\n")
for pathname, errs := range e.errs {
s += " " + pathname.Value() + ":\n"
buf.WriteString(" " + pathname.Value() + ":\n")
for _, err := range errs {
s += " " + err.Error() + "\n"
buf.WriteString(" " + err.Error() + "\n")
}
}
segments = append(segments, s)
segments = append(segments, buf.String())
}
return strings.Join(segments, "\n")
}