@@ -50,7 +50,7 @@ func NewMonitoring(config *Config, output *Output, discovery *Discovery, testing
5050
5151// MonitorCards continuously monitors for cards using proper InAutoPoll continuous polling
5252func (m * Monitoring ) MonitorCards (ctx context.Context , readers []detection.DeviceInfo , isQuick bool ) error {
53- fmt .Println ("\n Monitoring for cards... (Ctrl+C to quit)" )
53+ _ , _ = fmt .Println ("\n Monitoring for cards... (Ctrl+C to quit)" )
5454
5555 setup , err := m .initializeDevices (readers )
5656 if err != nil {
@@ -148,7 +148,9 @@ func (m *Monitoring) startMonitoringLoop(ctx context.Context, setup *MonitoringS
148148}
149149
150150// continuousPolling runs continuous InAutoPoll monitoring for a single reader
151- func (m * Monitoring ) continuousPolling (ctx context.Context , device * pn532.Device , readerPath string , state * CardState , isQuick bool ) error {
151+ func (m * Monitoring ) continuousPolling (
152+ ctx context.Context , device * pn532.Device , readerPath string , state * CardState , isQuick bool ,
153+ ) error {
152154 for {
153155 select {
154156 case <- ctx .Done ():
@@ -173,7 +175,7 @@ func (m *Monitoring) continuousPolling(ctx context.Context, device *pn532.Device
173175}
174176
175177// performSinglePoll performs a single tag detection cycle using the sophisticated strategy system
176- func (m * Monitoring ) performSinglePoll (ctx context.Context , device * pn532.Device ) (* pn532.DetectedTag , error ) {
178+ func (* Monitoring ) performSinglePoll (ctx context.Context , device * pn532.Device ) (* pn532.DetectedTag , error ) {
177179 // Use short timeout for responsive card removal detection
178180 pollCtx , cancel := context .WithTimeout (ctx , 50 * time .Millisecond )
179181 defer cancel ()
@@ -212,15 +214,17 @@ func (m *Monitoring) handleCardRemoval(state *CardState, readerPath string) {
212214}
213215
214216// resetCardState resets the card state to empty
215- func (m * Monitoring ) resetCardState (state * CardState ) {
217+ func (* Monitoring ) resetCardState (state * CardState ) {
216218 state .Present = false
217219 state .LastUID = ""
218220 state .LastType = ""
219221 state .TestedUID = ""
220222}
221223
222224// processPollingResults processes the detected tag
223- func (m * Monitoring ) processPollingResults (device * pn532.Device , detectedTag * pn532.DetectedTag , state * CardState , readerPath string , isQuick bool ) {
225+ func (m * Monitoring ) processPollingResults (
226+ device * pn532.Device , detectedTag * pn532.DetectedTag , state * CardState , readerPath string , isQuick bool ,
227+ ) {
224228 if detectedTag == nil {
225229 m .handleCardRemoval (state , readerPath )
226230 return
@@ -259,12 +263,14 @@ func (m *Monitoring) updateCardState(state *CardState, detectedTag *pn532.Detect
259263}
260264
261265// shouldTestCard determines if we should test the card
262- func (m * Monitoring ) shouldTestCard (state * CardState , currentUID string ) bool {
266+ func (* Monitoring ) shouldTestCard (state * CardState , currentUID string ) bool {
263267 return state .TestedUID != currentUID
264268}
265269
266270// testAndRecordCard tests the card and records the result
267- func (m * Monitoring ) testAndRecordCard (device * pn532.Device , detectedTag * pn532.DetectedTag , state * CardState , isQuick bool ) {
271+ func (m * Monitoring ) testAndRecordCard (
272+ device * pn532.Device , detectedTag * pn532.DetectedTag , state * CardState , isQuick bool ,
273+ ) {
268274 if err := m .testing .TestCard (device , detectedTag , TestMode {Quick : isQuick }); err != nil {
269275 m .output .Error ("Card test failed: %v" , err )
270276 } else {
@@ -296,7 +302,7 @@ func (m *Monitoring) CheckCardsQuick(readers []detection.DeviceInfo) {
296302
297303 tags , err := device .DetectTags (1 , 0x00 )
298304 if err == nil && len (tags ) > 0 {
299- fmt .Printf ("CARD: Card on %s: %s (UID: %s)\n " ,
305+ _ , _ = fmt .Printf ("CARD: Card on %s: %s (UID: %s)\n " ,
300306 reader .Path , tags [0 ].Type , tags [0 ].UID )
301307 }
302308
0 commit comments