Refactoring ineffectual assignments

This patch fixed below 4 types of code line
1. Remove unnecessary variable assignment
2. Use variables declaration instead of explicit initial zero value
3. Change variable name to underbar when variable not used
4. Add erro check and return for ignored error

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 266900235c
Component: cli
This commit is contained in:
Daehyeok Mun
2016-11-29 01:17:35 -07:00
parent 5c20fde4a3
commit df1baac4fc
2 changed files with 8 additions and 9 deletions

View File

@ -41,7 +41,9 @@ func validateConfig(path string) error {
// validateContextDir validates the given dir and returns abs path on success.
func validateContextDir(contextDir string) (string, error) {
absContextDir, err := filepath.Abs(contextDir)
if err != nil {
return "", err
}
stat, err := os.Lstat(absContextDir)
if err != nil {
return "", err