mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update gofumpt from v0.4.0 to v0.8.0 (#18652)
This commit is contained in:
+1
-1
@@ -446,7 +446,7 @@ func (r *RootCmd) configSSH() *serpent.Command {
|
||||
|
||||
if !bytes.Equal(configRaw, configModified) {
|
||||
sshDir := filepath.Dir(sshConfigFile)
|
||||
if err := os.MkdirAll(sshDir, 0700); err != nil {
|
||||
if err := os.MkdirAll(sshDir, 0o700); err != nil {
|
||||
return xerrors.Errorf("failed to create directory %q: %w", sshDir, err)
|
||||
}
|
||||
|
||||
|
||||
@@ -204,10 +204,11 @@ func TestConfigSSH_MissingDirectory(t *testing.T) {
|
||||
_, err = os.Stat(sshConfigPath)
|
||||
require.NoError(t, err, "config file should exist")
|
||||
|
||||
// Check that the directory has proper permissions (0700)
|
||||
// Check that the directory has proper permissions (rwx for owner, none for
|
||||
// group and everyone)
|
||||
sshDirInfo, err := os.Stat(sshDir)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, os.FileMode(0700), sshDirInfo.Mode().Perm(), "directory should have 0700 permissions")
|
||||
require.Equal(t, os.FileMode(0o700), sshDirInfo.Mode().Perm(), "directory should have rwx------ permissions")
|
||||
}
|
||||
|
||||
func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
|
||||
@@ -358,7 +359,8 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
|
||||
strings.Join([]string{
|
||||
headerEnd,
|
||||
"",
|
||||
}, "\n")},
|
||||
}, "\n"),
|
||||
},
|
||||
},
|
||||
args: []string{"--ssh-option", "ForwardAgent=yes"},
|
||||
matches: []match{
|
||||
@@ -383,7 +385,8 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
|
||||
strings.Join([]string{
|
||||
headerEnd,
|
||||
"",
|
||||
}, "\n")},
|
||||
}, "\n"),
|
||||
},
|
||||
},
|
||||
args: []string{"--ssh-option", "ForwardAgent=yes"},
|
||||
matches: []match{
|
||||
|
||||
Reference in New Issue
Block a user