mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-01-03 07:56:42 -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
|
return err
|
||||||
}
|
}
|
||||||
_, err = io.Copy(fileWriter, fileReader)
|
_, err = io.Copy(fileWriter, fileReader)
|
||||||
if err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (worker *ZipWorker) close() {
|
func (worker *ZipWorker) close() {
|
||||||
|
@ -28,42 +28,38 @@ const (
|
|||||||
|
|
||||||
func parseOS(rawOS string) GoOS {
|
func parseOS(rawOS string) GoOS {
|
||||||
osStr := strings.ToLower(rawOS)
|
osStr := strings.ToLower(rawOS)
|
||||||
if osStr == "windows" || osStr == "win" {
|
switch osStr {
|
||||||
|
case "windows", "win":
|
||||||
return Windows
|
return Windows
|
||||||
}
|
case "darwin", "mac", "macos", "osx":
|
||||||
if osStr == "darwin" || osStr == "mac" || osStr == "macos" || osStr == "osx" {
|
|
||||||
return MacOS
|
return MacOS
|
||||||
}
|
case "linux", "debian", "ubuntu", "redhat", "centos":
|
||||||
if osStr == "linux" || osStr == "debian" || osStr == "ubuntu" || osStr == "redhat" || osStr == "centos" {
|
|
||||||
return Linux
|
return Linux
|
||||||
}
|
case "freebsd":
|
||||||
if osStr == "freebsd" {
|
|
||||||
return FreeBSD
|
return FreeBSD
|
||||||
}
|
case "openbsd":
|
||||||
if osStr == "openbsd" {
|
|
||||||
return OpenBSD
|
return OpenBSD
|
||||||
}
|
default:
|
||||||
return UnknownOS
|
return UnknownOS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseArch(rawArch string) GoArch {
|
func parseArch(rawArch string) GoArch {
|
||||||
archStr := strings.ToLower(rawArch)
|
archStr := strings.ToLower(rawArch)
|
||||||
if archStr == "x86" || archStr == "386" || archStr == "i386" {
|
switch archStr {
|
||||||
|
case "x86", "386", "i386":
|
||||||
return X86
|
return X86
|
||||||
}
|
case "amd64", "x86-64", "x64":
|
||||||
if archStr == "amd64" || archStr == "x86-64" || archStr == "x64" {
|
|
||||||
return Amd64
|
return Amd64
|
||||||
}
|
case "arm":
|
||||||
if archStr == "arm" {
|
|
||||||
return Arm
|
return Arm
|
||||||
}
|
case "arm64":
|
||||||
if archStr == "arm64" {
|
|
||||||
return Arm64
|
return Arm64
|
||||||
}
|
case "mips", "mips64":
|
||||||
if archStr == "mips" || archStr == "mips64" {
|
|
||||||
return Mips64
|
return Mips64
|
||||||
}
|
default:
|
||||||
return UnknownArch
|
return UnknownArch
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func getSuffix(os GoOS, arch GoArch) string {
|
func getSuffix(os GoOS, arch GoArch) string {
|
||||||
|
Loading…
Reference in New Issue
Block a user