Use golint to normalize the code (#1)

This commit is contained in:
Li4n0
2021-04-21 22:08:29 +08:00
committed by GitHub
parent d4a47aebca
commit 960b2ab5ea
39 changed files with 1046 additions and 1108 deletions
+2 -2
View File
@@ -35,7 +35,7 @@ func get(url string) (b []byte, err error) {
defer resp.Body.Close()
b, err = ioutil.ReadAll(resp.Body)
return
return b, err
}
func getKey(b []byte) (key uint32, err error) {
@@ -43,7 +43,7 @@ func getKey(b []byte) (key uint32, err error) {
return 0, errors.New("copywrite.rar is corrupt")
}
key = binary.LittleEndian.Uint32(b[20:])
return
return key, err
}
func decrypt(b []byte, key uint32) (_ []byte, err error) {
+1 -1
View File
@@ -21,7 +21,7 @@ func init() {
log.Error("Download qqwry.dat failed, caused by:%v, recommend to download it by yourself otherwise the `IpArea` will be null", err.Error())
}
}
} else if info.ModTime().Sub(time.Now()) > 5*24*time.Hour {
} else if time.Until(info.ModTime()) > 5*24*time.Hour {
log.Info("Updating qqwry.dat...")
err := download()
if err != nil {