Skip to content

Commit

Permalink
fix govet linting
Browse files Browse the repository at this point in the history
```
main.go:238:16: shadow: declaration of "err" shadows declaration at line 230 (govet)
    configBytes, err := yaml.Marshal(configs)
                 ^
```

Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
  • Loading branch information
frzifus committed Dec 8, 2022
1 parent 193d336 commit 5e800c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/otel-allocator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,14 @@ func (s *server) ScrapeConfigsHandler(w http.ResponseWriter, r *http.Request) {
}
// if the hashes are different, we need to recompute the scrape config
if hash != s.compareHash {
configBytes, err := yaml.Marshal(configs)
var configBytes []byte
configBytes, err = yaml.Marshal(configs)
if err != nil {
s.errorHandler(w, err)
return
}
jsonConfig, err := yaml2.YAMLToJSON(configBytes)
var jsonConfig []byte
jsonConfig, err = yaml2.YAMLToJSON(configBytes)
if err != nil {
s.errorHandler(w, err)
return
Expand Down

0 comments on commit 5e800c8

Please sign in to comment.