From 386232f39ede046d6453a0990ad40f2d86a26f53 Mon Sep 17 00:00:00 2001 From: copilot-swe-agent[bot] Date: Mon, 7 Jul 2025 18:18:12 +0000 Subject: Fix all staticcheck errors in gocryptfs codebase Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> Add staticcheck to test.bash for continuous static analysis Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> Fix nil pointer dereference in timesToTimespec function The previous fix for deprecated fuse.UtimeToTimespec caused a panic because unix.TimeToTimespec doesn't handle nil pointers. This fix properly handles nil pointers by using unix.UTIME_OMIT while still using the non-deprecated unix.TimeToTimespec function. Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> Undo SA6002 changes and add staticcheck ignore directive instead Co-authored-by: rfjakob <286847+rfjakob@users.noreply.github.com> --- internal/ctlsocksrv/ctlsock_serve.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/ctlsocksrv/ctlsock_serve.go') diff --git a/internal/ctlsocksrv/ctlsock_serve.go b/internal/ctlsocksrv/ctlsock_serve.go index 85f5b65..25d1e44 100644 --- a/internal/ctlsocksrv/ctlsock_serve.go +++ b/internal/ctlsocksrv/ctlsock_serve.go @@ -101,7 +101,7 @@ func (ch *ctlSockHandler) handleRequest(in *ctlsock.RequestStruct, conn *net.Uni } // Neither encryption nor encryption has been requested, makes no sense if in.DecryptPath == "" && in.EncryptPath == "" { - err = errors.New("Empty input") + err = errors.New("empty input") sendResponse(conn, err, "", "") return } @@ -118,7 +118,7 @@ func (ch *ctlSockHandler) handleRequest(in *ctlsock.RequestStruct, conn *net.Uni } // Error out if the canonical path is now empty if clean == "" { - err = errors.New("Empty input after canonicalization") + err = errors.New("empty input after canonicalization") sendResponse(conn, err, "", warnText) return } -- cgit v1.2.3