Fix staticcheck errors on Windows.

This commit is contained in:
Qi Xiao 2022-06-05 22:46:24 +01:00
parent a91935ee93
commit 2c30cf9806
3 changed files with 4 additions and 2 deletions

View File

@ -1,3 +1,5 @@
//go:build !windows && !plan9
package term
import (

View File

@ -71,9 +71,9 @@ func (r *reader) Close() {
if err != nil {
log.Println("SetEvent:", err)
}
r.mutex.Lock()
//lint:ignore SA2001 We only lock the mutex to make sure that ReadEvent has
//exited, so we unlock it immediately.
r.mutex.Lock()
r.mutex.Unlock()
err = windows.CloseHandle(r.stopEvent)
if err != nil {

View File

@ -3,5 +3,5 @@ package testutil
// Umask sets the umask for the duration of the test, and restores it afterwards.
func Umask(c Cleanuper, m int) {
save := umask(m)
c.Cleanup(func() { umask(save) })
c.Cleanup(func() { _ = umask(save) })
}