Run vet and lint. Make us lint clean.
This commit is contained in:
@@ -21,13 +21,11 @@ func init() {
|
||||
Factories["external"] = NewExternal
|
||||
}
|
||||
|
||||
// The type holds our configuration
|
||||
type External struct {
|
||||
command string
|
||||
folderPath string
|
||||
}
|
||||
|
||||
// The constructor function takes a map of parameters and creates the type.
|
||||
func NewExternal(folderID, folderPath string, params map[string]string) Versioner {
|
||||
command := params["command"]
|
||||
|
||||
@@ -42,8 +40,8 @@ func NewExternal(folderID, folderPath string, params map[string]string) Versione
|
||||
return s
|
||||
}
|
||||
|
||||
// Move away the named file to a version archive. If this function returns
|
||||
// nil, the named file does not exist any more (has been archived).
|
||||
// Archive moves the named file away to a version archive. If this function
|
||||
// returns nil, the named file does not exist any more (has been archived).
|
||||
func (v External) Archive(filePath string) error {
|
||||
_, err := osutil.Lstat(filePath)
|
||||
if os.IsNotExist(err) {
|
||||
|
||||
@@ -19,13 +19,11 @@ func init() {
|
||||
Factories["simple"] = NewSimple
|
||||
}
|
||||
|
||||
// The type holds our configuration
|
||||
type Simple struct {
|
||||
keep int
|
||||
folderPath string
|
||||
}
|
||||
|
||||
// The constructor function takes a map of parameters and creates the type.
|
||||
func NewSimple(folderID, folderPath string, params map[string]string) Versioner {
|
||||
keep, err := strconv.Atoi(params["keep"])
|
||||
if err != nil {
|
||||
@@ -43,8 +41,8 @@ func NewSimple(folderID, folderPath string, params map[string]string) Versioner
|
||||
return s
|
||||
}
|
||||
|
||||
// Move away the named file to a version archive. If this function returns
|
||||
// nil, the named file does not exist any more (has been archived).
|
||||
// Archive moves the named file away to a version archive. If this function
|
||||
// returns nil, the named file does not exist any more (has been archived).
|
||||
func (v Simple) Archive(filePath string) error {
|
||||
fileInfo, err := osutil.Lstat(filePath)
|
||||
if os.IsNotExist(err) {
|
||||
|
||||
@@ -27,7 +27,6 @@ type Interval struct {
|
||||
end int64
|
||||
}
|
||||
|
||||
// The type holds our configuration
|
||||
type Staggered struct {
|
||||
versionsPath string
|
||||
cleanInterval int64
|
||||
@@ -62,7 +61,6 @@ func (v Staggered) renameOld() {
|
||||
}
|
||||
}
|
||||
|
||||
// The constructor function takes a map of parameters and creates the type.
|
||||
func NewStaggered(folderID, folderPath string, params map[string]string) Versioner {
|
||||
maxAge, err := strconv.ParseInt(params["maxAge"], 10, 0)
|
||||
if err != nil {
|
||||
@@ -271,8 +269,8 @@ func (v Staggered) expire(versions []string) {
|
||||
}
|
||||
}
|
||||
|
||||
// Move away the named file to a version archive. If this function returns
|
||||
// nil, the named file does not exist any more (has been archived).
|
||||
// Archive moves the named file away to a version archive. If this function
|
||||
// returns nil, the named file does not exist any more (has been archived).
|
||||
func (v Staggered) Archive(filePath string) error {
|
||||
if debug {
|
||||
l.Debugln("Waiting for lock on ", v.versionsPath)
|
||||
|
||||
Reference in New Issue
Block a user