Skip to content

Commit fa1d379

Browse files
authored
Merge pull request #4747 from kersten/fix/remove-unnecessary-string-conversion
🌱 (chore): remove unnecessary string() and []byte conversions
2 parents 248ff11 + f83713c commit fa1d379

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

docs/book/utils/litgo/literate.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func extractPairs(contents []byte, path string) ([]commentCodePair, error) {
170170
file := fileSet.AddFile(path, -1, len(contents))
171171
scan := scanner.Scanner{}
172172
var errs []error
173-
scan.Init(file, []byte(contents), func(pos token.Position, msg string) {
173+
scan.Init(file, contents, func(pos token.Position, msg string) {
174174
errs = append(errs, fmt.Errorf("error parsing file %s: %s", pos, msg))
175175
}, scanner.ScanComments)
176176

docs/book/utils/plugin/utils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func EachCommand(book *Book, cmd string, callback func(chapter *BookChapter, arg
4949
if err != nil {
5050
return err
5151
}
52-
res = append(res, string(newContents))
52+
res = append(res, newContents)
5353
res = append(res, part[endDelim+2:])
5454
}
5555

pkg/plugins/optional/grafana/v1alpha/scaffolds/edit.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (s *editScaffolder) Scaffold() error {
170170
// Initialize the machinery.Scaffold that will write the files to disk
171171
scaffold := machinery.NewScaffold(s.fs)
172172

173-
configPath := string(configFilePath)
173+
configPath := configFilePath
174174

175175
templatesBuilder := []machinery.Builder{
176176
&templates.RuntimeManifest{},

pkg/plugins/optional/grafana/v1alpha/scaffolds/init.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ func (s *initScaffolder) Scaffold() error {
5151
return scaffold.Execute(
5252
&templates.RuntimeManifest{},
5353
&templates.ResourcesManifest{},
54-
&templates.CustomMetricsConfigManifest{ConfigPath: string(configFilePath)},
54+
&templates.CustomMetricsConfigManifest{ConfigPath: configFilePath},
5555
)
5656
}

0 commit comments

Comments
 (0)