mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
fix lint warnings
This commit is contained in:
parent
3e73e66adb
commit
25c64f9694
@ -37,10 +37,7 @@ func (worker *ZipWorker) zipAllFiles(path string, info os.FileInfo, err error) e
|
||||
return err
|
||||
}
|
||||
_, err = io.Copy(fileWriter, fileReader)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (worker *ZipWorker) close() {
|
||||
|
@ -28,42 +28,38 @@ const (
|
||||
|
||||
func parseOS(rawOS string) GoOS {
|
||||
osStr := strings.ToLower(rawOS)
|
||||
if osStr == "windows" || osStr == "win" {
|
||||
switch osStr {
|
||||
case "windows", "win":
|
||||
return Windows
|
||||
}
|
||||
if osStr == "darwin" || osStr == "mac" || osStr == "macos" || osStr == "osx" {
|
||||
case "darwin", "mac", "macos", "osx":
|
||||
return MacOS
|
||||
}
|
||||
if osStr == "linux" || osStr == "debian" || osStr == "ubuntu" || osStr == "redhat" || osStr == "centos" {
|
||||
case "linux", "debian", "ubuntu", "redhat", "centos":
|
||||
return Linux
|
||||
}
|
||||
if osStr == "freebsd" {
|
||||
case "freebsd":
|
||||
return FreeBSD
|
||||
}
|
||||
if osStr == "openbsd" {
|
||||
case "openbsd":
|
||||
return OpenBSD
|
||||
default:
|
||||
return UnknownOS
|
||||
}
|
||||
return UnknownOS
|
||||
}
|
||||
|
||||
func parseArch(rawArch string) GoArch {
|
||||
archStr := strings.ToLower(rawArch)
|
||||
if archStr == "x86" || archStr == "386" || archStr == "i386" {
|
||||
switch archStr {
|
||||
case "x86", "386", "i386":
|
||||
return X86
|
||||
}
|
||||
if archStr == "amd64" || archStr == "x86-64" || archStr == "x64" {
|
||||
case "amd64", "x86-64", "x64":
|
||||
return Amd64
|
||||
}
|
||||
if archStr == "arm" {
|
||||
case "arm":
|
||||
return Arm
|
||||
}
|
||||
if archStr == "arm64" {
|
||||
case "arm64":
|
||||
return Arm64
|
||||
}
|
||||
if archStr == "mips" || archStr == "mips64" {
|
||||
case "mips", "mips64":
|
||||
return Mips64
|
||||
default:
|
||||
return UnknownArch
|
||||
}
|
||||
return UnknownArch
|
||||
}
|
||||
|
||||
func getSuffix(os GoOS, arch GoArch) string {
|
||||
|
Loading…
Reference in New Issue
Block a user