From f4a35981919d79769f3d451063cabcbccf37ca85 Mon Sep 17 00:00:00 2001 From: Conrad Hoffmann Date: Wed, 16 Mar 2022 15:11:06 +0100 Subject: [PATCH] Use simpler os.Create for writing files --- storage/filesystem.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/filesystem.go b/storage/filesystem.go index 72b8188..bb5f2be 100644 --- a/storage/filesystem.go +++ b/storage/filesystem.go @@ -298,7 +298,7 @@ func (b *filesystemBackend) PutAddressObject(ctx context.Context, path string, c return "", carddav.NewPreconditionError(carddav.PreconditionNoUIDConflict) } - f, err := os.OpenFile(localPath, os.O_RDWR|os.O_CREATE, 0644) + f, err := os.Create(localPath) if err != nil { return "", err }