Fix Golangci-lint configuration

This commit is contained in:
Maximilian Paß
2024-05-07 12:11:25 +02:00
parent 8c5e0e11f7
commit ec3b2a93db
6 changed files with 42 additions and 33 deletions

View File

@ -435,17 +435,21 @@ func fileDeletionCommand(pathsToDelete []dto.FilePath) string {
}
func tarHeader(file dto.File) *tar.Header {
// See #236. Sticky bit is to allow creating files next to write-protected files.
const directoryPermission int64 = 0o1777
const filePermission int64 = 0o744
if file.IsDirectory() {
return &tar.Header{
Typeflag: tar.TypeDir,
Name: file.CleanedPath(),
Mode: 0o1777, // See #236. Sticky bit is to allow creating files next to write-protected files.
Mode: directoryPermission,
}
} else {
return &tar.Header{
Typeflag: tar.TypeReg,
Name: file.CleanedPath(),
Mode: 0o744,
Mode: filePermission,
Size: int64(len(file.Content)),
}
}