mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-08-21 02:38:45 -04:00
dev: bytes.NewBuffer/bytes.NewBufferString to shorten initialization (#3632)
This commit is contained in:
parent
ca5738e1fe
commit
f4fec8c6d0
3 changed files with 5 additions and 12 deletions
pkg/commands
|
@ -157,8 +157,7 @@ func (e *Executor) initHashSalt(version string) error {
|
|||
return fmt.Errorf("failed to calculate config salt: %w", err)
|
||||
}
|
||||
|
||||
var b bytes.Buffer
|
||||
b.Write(binSalt)
|
||||
b := bytes.NewBuffer(binSalt)
|
||||
b.Write(configSalt)
|
||||
cache.SetSalt(b.Bytes())
|
||||
return nil
|
||||
|
@ -198,8 +197,7 @@ func computeConfigSalt(cfg *config.Config) ([]byte, error) {
|
|||
return nil, fmt.Errorf("failed to json marshal config linter settings: %w", err)
|
||||
}
|
||||
|
||||
var configData bytes.Buffer
|
||||
configData.WriteString("linters-settings=")
|
||||
configData := bytes.NewBufferString("linters-settings=")
|
||||
configData.Write(lintersSettingsBytes)
|
||||
configData.WriteString("\nbuild-tags=%s" + strings.Join(cfg.Run.BuildTags, ","))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue