Fix all the linter errors I care about

This commit is contained in:
idk
2022-02-07 15:34:45 -05:00
parent c9a77dc123
commit 1367cea3a3
8 changed files with 132 additions and 83 deletions

View File

@ -16,7 +16,7 @@ func (m *Client) generateMirrorJSON() (map[string]interface{}, error) {
if err != nil {
return nil, fmt.Errorf("GenerateMirrorJSON: %s", err)
}
binpath, _, err := m.TBD.GetUpdaterForLangFromJsonBytes(preBytes, "en-US")
binpath, _, err := m.TBD.GetUpdaterForLangFromJSONBytes(preBytes, "en-US")
if err != nil {
return nil, fmt.Errorf("GenerateMirrorJSON: %s", err)
}
@ -31,6 +31,7 @@ func (m *Client) generateMirrorJSON() (map[string]interface{}, error) {
return JSON, nil
}
// Hostname Returns the hostname of the client, if it has one.
func (m *Client) Hostname() string {
if !strings.HasSuffix(m.hostname, "/") {
return m.hostname + "/"
@ -38,6 +39,7 @@ func (m *Client) Hostname() string {
return m.hostname
}
// GenerateMirrorJSON generates the JSON file for the mirror.
func (m *Client) GenerateMirrorJSON() (string, error) {
JSON, err := m.generateMirrorJSON()
if err != nil {
@ -48,7 +50,7 @@ func (m *Client) GenerateMirrorJSON() (string, error) {
if err != nil {
return "", fmt.Errorf("GenerateMirrorJSONBytes: %s", err)
}
binpath, _, err := m.TBD.GetUpdaterForLangFromJsonBytes(preBytes, "en-US")
binpath, _, err := m.TBD.GetUpdaterForLangFromJSONBytes(preBytes, "en-US")
if err != nil {
return "", fmt.Errorf("GenerateMirrorJSONBytes: %s", err)
}
@ -77,6 +79,7 @@ func (m *Client) GenerateMirrorJSON() (string, error) {
return "", fmt.Errorf("GenerateMirrorJSONBytes: %s", "No downloads found")
}
// GenerateReplaceString generates the string to replace in the JSON file.
func GenerateReplaceString(urlparts []string) string {
replaceString := ""
for _, val := range urlparts {