Skip to content

Commit

Permalink
Avoid types juggling
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoVeille committed Jul 3, 2024
1 parent 56538e3 commit e89ae35
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ linters:
- gosimple
- govet
- ineffassign
# - mirror # requires golangci-lint 1.53
- misspell
- staticcheck
- structcheck
Expand Down
4 changes: 2 additions & 2 deletions pkg/mdformatter/mdformatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ func FormatFrontMatter(m map[string]interface{}) ([]byte, error) {
keys: keys,
}

b := bytes.NewBuffer([]byte("---\n"))
b := bytes.NewBufferString("---\n")
o, err := yaml.Marshal(f)
if err != nil {
return nil, fmt.Errorf("marshall front matter: %w", err)
}
_, _ = b.Write(o)
_, _ = b.Write([]byte("---\n\n"))
_, _ = b.WriteString("---\n\n")
return b.Bytes(), nil
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/copyright/copyright.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func applyLicenseToProtoAndGo() error {
return err
}

if !strings.HasPrefix(string(b), string(license)) {
if !bytes.HasPrefix(b, license) {
log.Println("file", path, "is missing Copyright header. Adding.")

var bb bytes.Buffer
Expand Down

0 comments on commit e89ae35

Please sign in to comment.