feat: do not distinguish errors for simple case

Failed to read file can result in error not existt
main
sudo pacman -Syu 2021-05-05 16:39:31 +07:00
parent a08fd5bf8e
commit 31308c6ead
1 changed files with 0 additions and 5 deletions

View File

@ -2,7 +2,6 @@ package config
import ( import (
"encoding/json" "encoding/json"
"errors"
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
@ -39,10 +38,6 @@ func LoadConfig(path string) (*configReal, *configDemo, error) {
configPath := getConfigPath(path) configPath := getConfigPath(path)
bytes, err := os.ReadFile(configPath) bytes, err := os.ReadFile(configPath)
if err != nil { if err != nil {
if errors.Is(err, os.ErrNotExist) {
return nil, nil, fmt.Errorf("file not exist %s: %w", configPath, err)
}
return nil, nil, fmt.Errorf("failed to read file%s: %w", configPath, err) return nil, nil, fmt.Errorf("failed to read file%s: %w", configPath, err)
} }