From 9dc854acec9969a3fa32b20cc5a26549c7964be7 Mon Sep 17 00:00:00 2001 From: Oleksand Matviienko Date: Tue, 22 Oct 2024 15:17:18 +0200 Subject: [PATCH] fix: Commented unused code --- pkg/permission/windows.go | 56 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/pkg/permission/windows.go b/pkg/permission/windows.go index 2169951..00cf5cf 100644 --- a/pkg/permission/windows.go +++ b/pkg/permission/windows.go @@ -1,30 +1,30 @@ package permission -import ( - "fmt" - "golang.org/x/sys/windows" - "os" - "strings" - "syscall" -) - -func RunMeElevated() error { - verb := "runas" - exe, _ := os.Executable() - cwd, _ := os.Getwd() - args := strings.Join(os.Args[1:], " ") - - verbPtr, _ := syscall.UTF16PtrFromString(verb) - exePtr, _ := syscall.UTF16PtrFromString(exe) - cwdPtr, _ := syscall.UTF16PtrFromString(cwd) - argPtr, _ := syscall.UTF16PtrFromString(args) - - var showCmd int32 = 1 //SW_NORMAL - - err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd) - if err != nil { - return fmt.Errorf("windows shell execute: %w", err) - } - - return nil -} +//import ( +// "fmt" +// "golang.org/x/sys/windows" +// "os" +// "strings" +// "syscall" +//) +// +//func RunMeElevated() error { +// verb := "runas" +// exe, _ := os.Executable() +// cwd, _ := os.Getwd() +// args := strings.Join(os.Args[1:], " ") +// +// verbPtr, _ := syscall.UTF16PtrFromString(verb) +// exePtr, _ := syscall.UTF16PtrFromString(exe) +// cwdPtr, _ := syscall.UTF16PtrFromString(cwd) +// argPtr, _ := syscall.UTF16PtrFromString(args) +// +// var showCmd int32 = 1 //SW_NORMAL +// +// err := windows.ShellExecute(0, verbPtr, exePtr, argPtr, cwdPtr, showCmd) +// if err != nil { +// return fmt.Errorf("windows shell execute: %w", err) +// } +// +// return nil +//}