From dcf9f695152b94a650b0c028b5fb04a368b58d96 Mon Sep 17 00:00:00 2001 From: Nikolai Papin Date: Tue, 25 Nov 2025 17:55:50 +0300 Subject: [PATCH] fix: mutex in wholescreencapturer --- .../screencapturer/wholescreencapturer.go | 14 ++++++------- src/utils/platform.go | 20 ------------------- 2 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 src/utils/platform.go diff --git a/src/internal/screencapturer/wholescreencapturer.go b/src/internal/screencapturer/wholescreencapturer.go index 12c43bc..8b00a09 100644 --- a/src/internal/screencapturer/wholescreencapturer.go +++ b/src/internal/screencapturer/wholescreencapturer.go @@ -64,13 +64,13 @@ type wholeScreenCapturer struct { func (w *wholeScreenCapturer) Get() (filepath string, err error) { w.mu.RLock() defer w.mu.Unlock() - if !w.initialized { - return "", ErrNotInitialized - } - if w.latest == "" { - return "", errors.New("no screenshot captured yet") - } - return w.latest, nil + if !w.initialized { + return "", ErrNotInitialized + } + if w.latest == "" { + return "", errors.New("no screenshot captured yet") + } + return w.latest, nil } // Init implements ScreenCapturer. diff --git a/src/utils/platform.go b/src/utils/platform.go deleted file mode 100644 index f898cdc..0000000 --- a/src/utils/platform.go +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 2025 Nikolai Papin -// -// This file is part of the Auto Attendance app that looks for -// self-attend QR-codes during lectures and opens their URLs in your -// browser. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See -// the GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . - -package platform