Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
batphonghan committed Nov 2, 2023
1 parent 1d748f4 commit 2ae24fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ linters:
- prealloc
- predeclared
- revive
- stylecheck
- staticcheck
- thelper
- tparallel
- typecheck
Expand Down
6 changes: 3 additions & 3 deletions shared/services/stader/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,18 +798,18 @@ func (c *Client) UpdateGuardianConfiguration(contents []byte) error {

guardianTemplatePath, err := homedir.Expand(fmt.Sprintf("%s/%s/%s", c.configPath, templatesDir, GuardianFileTemplate))
if err != nil {
return fmt.Errorf("Error expanding Guardian template path: %w", err)
return fmt.Errorf("error expanding Guardian template path: %w", err)
}

guardianConfigPath, err := homedir.Expand(fmt.Sprintf("%s/%s", c.configPath, GuardianFile))
if err != nil {
return fmt.Errorf("Error expanding guardian config file path: %w", err)
return fmt.Errorf("error expanding guardian config file path: %w", err)
}

// Write the actual Prometheus config file
err = os.WriteFile(guardianTemplatePath, contents, 0664)
if err != nil {
return fmt.Errorf("Could not write guardian config file to %s: %w", shellescape.Quote(guardianConfigPath), err)
return fmt.Errorf("could not write guardian config file to %s: %w", shellescape.Quote(guardianConfigPath), err)
}

return nil
Expand Down

0 comments on commit 2ae24fc

Please sign in to comment.