forked from Silverfish/proton-bridge
Other: go mod tidy/goimports/gofumpt after rebase on devel
This commit is contained in:
@ -30,7 +30,7 @@ func moveDir(from, to string) error {
|
||||
|
||||
for _, entry := range entries {
|
||||
if entry.IsDir() {
|
||||
if err := os.Mkdir(filepath.Join(to, entry.Name()), 0700); err != nil {
|
||||
if err := os.Mkdir(filepath.Join(to, entry.Name()), 0o700); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ func moveDir(from, to string) error {
|
||||
}
|
||||
|
||||
func move(from, to string) error {
|
||||
if err := os.MkdirAll(filepath.Dir(to), 0700); err != nil {
|
||||
if err := os.MkdirAll(filepath.Dir(to), 0o700); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ func move(from, to string) error {
|
||||
}
|
||||
defer func() { _ = f.Close() }()
|
||||
|
||||
if err := os.Chmod(to, 0600); err != nil {
|
||||
if err := os.Chmod(to, 0o600); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@ -27,16 +27,16 @@ func TestMoveDir(t *testing.T) {
|
||||
from, to := t.TempDir(), t.TempDir()
|
||||
|
||||
// Create some files in from.
|
||||
if err := os.WriteFile(filepath.Join(from, "a"), []byte("a"), 0600); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(from, "a"), []byte("a"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(from, "b"), []byte("b"), 0600); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(from, "b"), []byte("b"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.Mkdir(filepath.Join(from, "c"), 0700); err != nil {
|
||||
if err := os.Mkdir(filepath.Join(from, "c"), 0o700); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if err := os.WriteFile(filepath.Join(from, "c", "d"), []byte("d"), 0600); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(from, "c", "d"), []byte("d"), 0o600); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
||||
@ -141,7 +141,7 @@ func getGluonDir(encVault *vault.Vault) (string, error) {
|
||||
}
|
||||
|
||||
if !exists {
|
||||
if err := os.MkdirAll(encVault.GetGluonDir(), 0700); err != nil {
|
||||
if err := os.MkdirAll(encVault.GetGluonDir(), 0o700); err != nil {
|
||||
return "", fmt.Errorf("failed to create gluon dir: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user