Skip to content

Commit

Permalink
remove "os" import
Browse files Browse the repository at this point in the history
os.Getppid() is an alias for syscall.Getppid(), which was
already imported, so use it directly instead of the alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Nov 6, 2022
1 parent 109353e commit 15567a6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions trap_windows.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mousetrap

import (
"os"
"syscall"
"unsafe"
)
Expand Down Expand Up @@ -35,7 +34,7 @@ func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
// It does not guarantee that the program was run from a terminal. It only can tell you
// whether it was launched from explorer.exe
func StartedByExplorer() bool {
pe, err := getProcessEntry(os.Getppid())
pe, err := getProcessEntry(syscall.Getppid())
if err != nil {
return false
}
Expand Down

0 comments on commit 15567a6

Please sign in to comment.