Dependency updates

This commit is contained in:
Stash Dev
2019-05-27 12:34:26 -07:00
parent 69917999ef
commit 4b037e1040
359 changed files with 60172 additions and 18749 deletions

View File

@@ -84,27 +84,24 @@ func (f *File) Close() error {
}
func (f *File) First() (version uint, err error) {
if v, ok := f.migrations.First(); !ok {
return 0, &os.PathError{Op: "first", Path: f.path, Err: os.ErrNotExist}
} else {
if v, ok := f.migrations.First(); ok {
return v, nil
}
return 0, &os.PathError{Op: "first", Path: f.path, Err: os.ErrNotExist}
}
func (f *File) Prev(version uint) (prevVersion uint, err error) {
if v, ok := f.migrations.Prev(version); !ok {
return 0, &os.PathError{Op: fmt.Sprintf("prev for version %v", version), Path: f.path, Err: os.ErrNotExist}
} else {
if v, ok := f.migrations.Prev(version); ok {
return v, nil
}
return 0, &os.PathError{Op: fmt.Sprintf("prev for version %v", version), Path: f.path, Err: os.ErrNotExist}
}
func (f *File) Next(version uint) (nextVersion uint, err error) {
if v, ok := f.migrations.Next(version); !ok {
return 0, &os.PathError{Op: fmt.Sprintf("next for version %v", version), Path: f.path, Err: os.ErrNotExist}
} else {
if v, ok := f.migrations.Next(version); ok {
return v, nil
}
return 0, &os.PathError{Op: fmt.Sprintf("next for version %v", version), Path: f.path, Err: os.ErrNotExist}
}
func (f *File) ReadUp(version uint) (r io.ReadCloser, identifier string, err error) {

View File

@@ -67,7 +67,7 @@ func (i *Migrations) Append(m *Migration) (ok bool) {
func (i *Migrations) buildIndex() {
i.index = make(uintSlice, 0)
for version, _ := range i.migrations {
for version := range i.migrations {
i.index = append(i.index, version)
}
sort.Sort(i.index)