mirror of
https://github.com/luckfox-eng29/kvm.git
synced 2026-01-18 03:28:19 +01:00
Chore: Enable golangci-lint
Add a GitHub actions workflow to run golangci-lint. Signed-off-by: SuperQ <superq@gmail.com>
This commit is contained in:
14
serial.go
14
serial.go
@@ -16,14 +16,14 @@ const serialPortPath = "/dev/ttyS3"
|
||||
var port serial.Port
|
||||
|
||||
func mountATXControl() error {
|
||||
port.SetMode(defaultMode)
|
||||
_ = port.SetMode(defaultMode)
|
||||
go runATXControl()
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func unmountATXControl() error {
|
||||
reopenSerialPort()
|
||||
_ = reopenSerialPort()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -122,13 +122,13 @@ func pressATXResetButton(duration time.Duration) error {
|
||||
}
|
||||
|
||||
func mountDCControl() error {
|
||||
port.SetMode(defaultMode)
|
||||
_ = port.SetMode(defaultMode)
|
||||
go runDCControl()
|
||||
return nil
|
||||
}
|
||||
|
||||
func unmountDCControl() error {
|
||||
reopenSerialPort()
|
||||
_ = reopenSerialPort()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -212,11 +212,11 @@ var defaultMode = &serial.Mode{
|
||||
}
|
||||
|
||||
func initSerialPort() {
|
||||
reopenSerialPort()
|
||||
_ = reopenSerialPort()
|
||||
if config.ActiveExtension == "atx-power" {
|
||||
mountATXControl()
|
||||
_ = mountATXControl()
|
||||
} else if config.ActiveExtension == "dc-power" {
|
||||
mountDCControl()
|
||||
_ = mountDCControl()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user