source: apply some Golint rules

This commit is contained in:
bep 2015-03-07 12:58:39 +01:00
parent e007c9b25d
commit a91bcd85e2
2 changed files with 17 additions and 21 deletions

View file

@ -53,19 +53,17 @@ func (f *File) BaseFileName() string {
func (f *File) Section() string { func (f *File) Section() string {
if f.section != "" { if f.section != "" {
return f.section return f.section
} else { }
f.section = helpers.GuessSection(f.Dir()) f.section = helpers.GuessSection(f.Dir())
return f.section return f.section
}
} }
func (f *File) LogicalName() string { func (f *File) LogicalName() string {
if f.logicalName != "" { if f.logicalName != "" {
return f.logicalName return f.logicalName
} else { }
_, f.logicalName = filepath.Split(f.relpath) _, f.logicalName = filepath.Split(f.relpath)
return f.logicalName return f.logicalName
}
} }
func (f *File) SetDir(dir string) { func (f *File) SetDir(dir string) {
@ -75,19 +73,17 @@ func (f *File) SetDir(dir string) {
func (f *File) Dir() string { func (f *File) Dir() string {
if f.dir != "" { if f.dir != "" {
return f.dir return f.dir
} else { }
f.dir, _ = filepath.Split(f.relpath) f.dir, _ = filepath.Split(f.relpath)
return f.dir return f.dir
}
} }
func (f *File) Extension() string { func (f *File) Extension() string {
if f.ext != "" { if f.ext != "" {
return f.ext return f.ext
} else { }
f.ext = strings.TrimPrefix(filepath.Ext(f.LogicalName()), ".") f.ext = strings.TrimPrefix(filepath.Ext(f.LogicalName()), ".")
return f.ext return f.ext
}
} }
func (f *File) Ext() string { func (f *File) Ext() string {

View file

@ -107,7 +107,8 @@ func (f *Filesystem) captureFiles() {
return filepath.SkipDir return filepath.SkipDir
} }
return nil return nil
} else { }
if isNonProcessablePath(filePath) { if isNonProcessablePath(filePath) {
return nil return nil
} }
@ -118,7 +119,6 @@ func (f *Filesystem) captureFiles() {
f.add(filePath, bytes.NewBuffer(data)) f.add(filePath, bytes.NewBuffer(data))
return nil return nil
} }
}
filepath.Walk(f.Base, walker) filepath.Walk(f.Base, walker)
} }