Skip to content

Commit e89ae35

Browse files
committed
Avoid types juggling
1 parent 56538e3 commit e89ae35

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ linters:
3939
- gosimple
4040
- govet
4141
- ineffassign
42+
# - mirror # requires golangci-lint 1.53
4243
- misspell
4344
- staticcheck
4445
- structcheck

pkg/mdformatter/mdformatter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,13 @@ func FormatFrontMatter(m map[string]interface{}) ([]byte, error) {
182182
keys: keys,
183183
}
184184

185-
b := bytes.NewBuffer([]byte("---\n"))
185+
b := bytes.NewBufferString("---\n")
186186
o, err := yaml.Marshal(f)
187187
if err != nil {
188188
return nil, fmt.Errorf("marshall front matter: %w", err)
189189
}
190190
_, _ = b.Write(o)
191-
_, _ = b.Write([]byte("---\n\n"))
191+
_, _ = b.WriteString("---\n\n")
192192
return b.Bytes(), nil
193193
}
194194

scripts/copyright/copyright.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func applyLicenseToProtoAndGo() error {
4646
return err
4747
}
4848

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

5252
var bb bytes.Buffer

0 commit comments

Comments
 (0)