mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00

full diff: https://github.com/docker/cli/compare/v28.0.1...v28.0.2 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
21 lines
442 B
Go
21 lines
442 B
Go
package manager
|
|
|
|
import (
|
|
"fmt"
|
|
"path/filepath"
|
|
"strings"
|
|
)
|
|
|
|
// This is made slightly more complex due to needing to be case-insensitive.
|
|
func trimExeSuffix(s string) (string, error) {
|
|
ext := filepath.Ext(s)
|
|
if ext == "" || !strings.EqualFold(ext, ".exe") {
|
|
return "", fmt.Errorf("path %q lacks required file extension (.exe)", s)
|
|
}
|
|
return strings.TrimSuffix(s, ext), nil
|
|
}
|
|
|
|
func addExeSuffix(s string) string {
|
|
return s + ".exe"
|
|
}
|