Skip to content

Commit

Permalink
Simplify byte slice to string conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Jul 10, 2024
1 parent 929e83c commit 803a99c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion static/logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func (i *Instance) ApplyConfig(c *InstanceConfig, g GlobalConfig, dryRun bool) e
if err != nil {
return fmt.Errorf("failed to marshal new logs instance config: %w", err)
}
newConfig := string(newConfigByteArr[:])
newConfig := string(newConfigByteArr)
if newConfig == i.previousConfig {
level.Debug(i.log).Log("msg", "instance config hasn't changed, not recreating Promtail")
return nil
Expand Down
2 changes: 1 addition & 1 deletion static/metrics/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ func (a *Agent) ApplyConfig(cfg Config) error {
if err != nil {
return fmt.Errorf("failed to marshal new config: %w", err)
}
newConfig := string(newConfigByteArr[:])
newConfig := string(newConfigByteArr)
if newConfig == a.previousConfig {
level.Debug(a.logger).Log("msg", "not recreating metrics instance because config hasn't changed")
return nil
Expand Down

0 comments on commit 803a99c

Please sign in to comment.