github.com/sleungcy-sap/cli@v7.1.0+incompatible/util/generic/executable_filename_windows.go (about) 1 // +build windows 2 3 package generic 4 5 import ( 6 "fmt" 7 "strings" 8 ) 9 10 // ExecutableFilename appends '.exe' to a filename when necessary in order to 11 // make it executable on Windows 12 func ExecutableFilename(name string) string { 13 if strings.HasSuffix(name, ".exe") { 14 return name 15 } 16 return fmt.Sprintf("%s.exe", name) 17 }