mirror of
https://github.com/helm/helm.git
synced 2026-04-22 14:47:41 -04:00
Merge pull request #31132 from joemicky/main
refactor: replace []byte(fmt.Sprintf) with fmt.Appendf
This commit is contained in:
commit
3726d01c5c
4 changed files with 6 additions and 6 deletions
|
|
@ -733,12 +733,12 @@ func Create(name, dir string) (string, error) {
|
|||
{
|
||||
// Chart.yaml
|
||||
path: filepath.Join(cdir, ChartfileName),
|
||||
content: []byte(fmt.Sprintf(defaultChartfile, name)),
|
||||
content: fmt.Appendf(nil, defaultChartfile, name),
|
||||
},
|
||||
{
|
||||
// values.yaml
|
||||
path: filepath.Join(cdir, ValuesfileName),
|
||||
content: []byte(fmt.Sprintf(defaultValues, name)),
|
||||
content: fmt.Appendf(nil, defaultValues, name),
|
||||
},
|
||||
{
|
||||
// .helmignore
|
||||
|
|
|
|||
|
|
@ -733,12 +733,12 @@ func Create(name, dir string) (string, error) {
|
|||
{
|
||||
// Chart.yaml
|
||||
path: filepath.Join(cdir, ChartfileName),
|
||||
content: []byte(fmt.Sprintf(defaultChartfile, name)),
|
||||
content: fmt.Appendf(nil, defaultChartfile, name),
|
||||
},
|
||||
{
|
||||
// values.yaml
|
||||
path: filepath.Join(cdir, ValuesfileName),
|
||||
content: []byte(fmt.Sprintf(defaultValues, name)),
|
||||
content: fmt.Appendf(nil, defaultValues, name),
|
||||
},
|
||||
{
|
||||
// .helmignore
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ func setup(suite *TestSuite, tlsEnabled, insecure bool) *registry.Registry {
|
|||
pwBytes, err := bcrypt.GenerateFromPassword([]byte(testPassword), bcrypt.DefaultCost)
|
||||
suite.Nil(err, "no error generating bcrypt password for test htpasswd file")
|
||||
htpasswdPath := filepath.Join(suite.WorkspaceDir, testHtpasswdFileBasename)
|
||||
err = os.WriteFile(htpasswdPath, []byte(fmt.Sprintf("%s:%s\n", testUsername, string(pwBytes))), 0644)
|
||||
err = os.WriteFile(htpasswdPath, fmt.Appendf(nil, "%s:%s\n", testUsername, string(pwBytes)), 0644)
|
||||
suite.Nil(err, "no error creating test htpasswd file")
|
||||
|
||||
// Registry config
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ func NewOCIServer(t *testing.T, dir string) (*OCIServer, error) {
|
|||
t.Fatal("error generating bcrypt password for test htpasswd file")
|
||||
}
|
||||
htpasswdPath := filepath.Join(dir, testHtpasswdFileBasename)
|
||||
err = os.WriteFile(htpasswdPath, []byte(fmt.Sprintf("%s:%s\n", testUsername, string(pwBytes))), 0o644)
|
||||
err = os.WriteFile(htpasswdPath, fmt.Appendf(nil, "%s:%s\n", testUsername, string(pwBytes)), 0o644)
|
||||
if err != nil {
|
||||
t.Fatalf("error creating test htpasswd file")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue