errors: rewrite errors to follow go best practices

Errors should not start capitalised and they should not contain the word error
or state that they "failed" as we already know it is an error

Signed-off-by: Kristoffer Dalby <kristoffer@dalby.cc>
This commit is contained in:
Kristoffer Dalby
2026-02-05 16:29:54 +00:00
parent 4a9a329339
commit 3acce2da87
30 changed files with 300 additions and 300 deletions

View File

@@ -59,17 +59,17 @@ func WriteFileToContainer(
err := tarWriter.WriteHeader(header)
if err != nil {
return fmt.Errorf("failed write file header to tar: %w", err)
return fmt.Errorf("writing file header to tar: %w", err)
}
_, err = io.Copy(tarWriter, file)
if err != nil {
return fmt.Errorf("failed to copy file to tar: %w", err)
return fmt.Errorf("copying file to tar: %w", err)
}
err = tarWriter.Close()
if err != nil {
return fmt.Errorf("failed to close tar: %w", err)
return fmt.Errorf("closing tar: %w", err)
}
// Ensure the directory is present inside the container
@@ -79,7 +79,7 @@ func WriteFileToContainer(
[]string{},
)
if err != nil {
return fmt.Errorf("failed to ensure directory: %w", err)
return fmt.Errorf("ensuring directory: %w", err)
}
err = pool.Client.UploadToContainer(