From 228c2b2c10c376fc0f3bb06fa4496e53b3ed8503 Mon Sep 17 00:00:00 2001 From: Umberto Baldi Date: Tue, 16 Apr 2024 10:36:24 +0200 Subject: [PATCH] make linter happy --- args/args.go | 3 +++ main.go | 7 ++++++- version/version.go | 6 ++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/args/args.go b/args/args.go index 998a32b..8ce04f6 100644 --- a/args/args.go +++ b/args/args.go @@ -15,6 +15,9 @@ // a commercial license, send an email to license@arduino.cc. // +// Package args provides functionality to parse command-line arguments. +// It includes a function to parse arguments passed by the user and a variable to check if the version flag is set. +// The package also handles invalid arguments by printing an error message and exiting the program. package args import ( diff --git a/main.go b/main.go index 3b852f6..a5dc48e 100644 --- a/main.go +++ b/main.go @@ -15,6 +15,7 @@ // a commercial license, send an email to license@arduino.cc. // +// Package main implements the serial monitor package main import ( @@ -106,6 +107,7 @@ func NewSerialMonitor() *SerialMonitor { } // Hello is the handler for the pluggable-monitor HELLO command +// revive:disable:unused-parameter func (d *SerialMonitor) Hello(userAgent string, protocol int) error { return nil } @@ -171,7 +173,10 @@ func (d *SerialMonitor) Close() error { if !d.openedPort { return errors.New("port already closed") } - d.serialPort.Close() + err := d.serialPort.Close() + if err != nil { + return err + } d.openedPort = false return nil } diff --git a/version/version.go b/version/version.go index f4b78d2..f23be4a 100644 --- a/version/version.go +++ b/version/version.go @@ -15,6 +15,12 @@ // a commercial license, send an email to license@arduino.cc. // +// Package version provides information about the version of the application. +// It includes the version string, commit hash, and timestamp. +// The package also defines a struct `Info` that represents the version information. +// The `newInfo` function creates a new `Info` instance with the provided application name. +// The `String` method of the `Info` struct returns a formatted string representation of the version information. +// The package also initializes the `Version` variable with a default version string if it is empty. package version import (