1
0
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:
Darien Raymond 2016-12-21 16:44:59 +01:00
parent 3e73e66adb
commit 25c64f9694
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
2 changed files with 17 additions and 24 deletions

View File

@ -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() {

View File

@ -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 {