mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
source: apply some Golint rules
This commit is contained in:
@@ -53,20 +53,18 @@ func (f *File) BaseFileName() string {
|
||||
func (f *File) Section() string {
|
||||
if f.section != "" {
|
||||
return f.section
|
||||
} else {
|
||||
}
|
||||
f.section = helpers.GuessSection(f.Dir())
|
||||
return f.section
|
||||
}
|
||||
}
|
||||
|
||||
func (f *File) LogicalName() string {
|
||||
if f.logicalName != "" {
|
||||
return f.logicalName
|
||||
} else {
|
||||
}
|
||||
_, f.logicalName = filepath.Split(f.relpath)
|
||||
return f.logicalName
|
||||
}
|
||||
}
|
||||
|
||||
func (f *File) SetDir(dir string) {
|
||||
f.dir = dir
|
||||
@@ -75,20 +73,18 @@ func (f *File) SetDir(dir string) {
|
||||
func (f *File) Dir() string {
|
||||
if f.dir != "" {
|
||||
return f.dir
|
||||
} else {
|
||||
}
|
||||
f.dir, _ = filepath.Split(f.relpath)
|
||||
return f.dir
|
||||
}
|
||||
}
|
||||
|
||||
func (f *File) Extension() string {
|
||||
if f.ext != "" {
|
||||
return f.ext
|
||||
} else {
|
||||
}
|
||||
f.ext = strings.TrimPrefix(filepath.Ext(f.LogicalName()), ".")
|
||||
return f.ext
|
||||
}
|
||||
}
|
||||
|
||||
func (f *File) Ext() string {
|
||||
return f.Extension()
|
||||
|
@@ -107,7 +107,8 @@ func (f *Filesystem) captureFiles() {
|
||||
return filepath.SkipDir
|
||||
}
|
||||
return nil
|
||||
} else {
|
||||
}
|
||||
|
||||
if isNonProcessablePath(filePath) {
|
||||
return nil
|
||||
}
|
||||
@@ -118,7 +119,6 @@ func (f *Filesystem) captureFiles() {
|
||||
f.add(filePath, bytes.NewBuffer(data))
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
filepath.Walk(f.Base, walker)
|
||||
}
|
||||
|
Reference in New Issue
Block a user