Update to go 1.19

This commit is contained in:
9seconds
2022-08-09 17:41:59 +03:00
parent 9d67414db6
commit f48156814b
60 changed files with 260 additions and 260 deletions
+6 -6
View File
@@ -12,8 +12,8 @@ import (
)
const (
addressesURLV4 = "https://core.telegram.org/getProxyConfig" // nolint: gas
addressesURLV6 = "https://core.telegram.org/getProxyConfigV6" // nolint: gas
addressesURLV4 = "https://core.telegram.org/getProxyConfig" //nolint: gas
addressesURLV6 = "https://core.telegram.org/getProxyConfigV6" //nolint: gas
)
var addressesProxyForSplitter = regexp.MustCompile(`\s+`)
@@ -74,12 +74,12 @@ func getAddresses(url string) (map[conntypes.DC][]string, conntypes.DC, error) {
}
func addressesParseProxyFor(text string) (string, conntypes.DC, error) {
chunks := addressesProxyForSplitter.Split(text, 3) // nolint: gomnd
chunks := addressesProxyForSplitter.Split(text, 3) //nolint: gomnd
if len(chunks) != 3 || chunks[0] != "proxy_for" {
return "", 0, fmt.Errorf("incorrect config %s", text)
}
dc, err := strconv.ParseInt(chunks[1], 10, 16) // nolint: gomnd
dc, err := strconv.ParseInt(chunks[1], 10, 16) //nolint: gomnd
if err != nil {
return "", 0, fmt.Errorf("incorrect config '%s': %w", text, err)
}
@@ -93,14 +93,14 @@ func addressesParseProxyFor(text string) (string, conntypes.DC, error) {
}
func addressesParseDefault(text string) (conntypes.DC, error) {
chunks := addressesProxyForSplitter.Split(text, 2) // nolint: gomnd
chunks := addressesProxyForSplitter.Split(text, 2) //nolint: gomnd
if len(chunks) != 2 || chunks[0] != "default" {
return 0, fmt.Errorf("incorrect config '%s'", text)
}
dcString := strings.TrimRight(chunks[1], ";")
dc, err := strconv.ParseInt(dcString, 10, 16) // nolint: gomnd
dc, err := strconv.ParseInt(dcString, 10, 16) //nolint: gomnd
if err != nil {
return 0, fmt.Errorf("incorrect config '%s': %w", text, err)
}