Skip to content

Commit

Permalink
Merge pull request #43 from wmetaw/master
Browse files Browse the repository at this point in the history
Fixed unkeyed fields in file.go for GoogleAppEngine
  • Loading branch information
dhui committed May 31, 2018
2 parents faf4307 + 6fa8039 commit c984265
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,23 @@ func (f *File) Close() error {

func (f *File) First() (version uint, err error) {
if v, ok := f.migrations.First(); !ok {
return 0, &os.PathError{"first", f.path, os.ErrNotExist}
return 0, &os.PathError{Op: "first", Path: f.path, Err: os.ErrNotExist}
} else {
return v, nil
}
}

func (f *File) Prev(version uint) (prevVersion uint, err error) {
if v, ok := f.migrations.Prev(version); !ok {
return 0, &os.PathError{fmt.Sprintf("prev for version %v", version), f.path, os.ErrNotExist}
return 0, &os.PathError{Op: fmt.Sprintf("prev for version %v", version), Path: f.path, Err: os.ErrNotExist}
} else {
return v, nil
}
}

func (f *File) Next(version uint) (nextVersion uint, err error) {
if v, ok := f.migrations.Next(version); !ok {
return 0, &os.PathError{fmt.Sprintf("next for version %v", version), f.path, os.ErrNotExist}
return 0, &os.PathError{Op: fmt.Sprintf("next for version %v", version), Path: f.path, Err: os.ErrNotExist}
} else {
return v, nil
}
Expand All @@ -112,7 +112,7 @@ func (f *File) ReadUp(version uint) (r io.ReadCloser, identifier string, err err
}
return r, m.Identifier, nil
}
return nil, "", &os.PathError{fmt.Sprintf("read version %v", version), f.path, os.ErrNotExist}
return nil, "", &os.PathError{Op: fmt.Sprintf("read version %v", version), Path: f.path, Err: os.ErrNotExist}
}

func (f *File) ReadDown(version uint) (r io.ReadCloser, identifier string, err error) {
Expand All @@ -123,5 +123,5 @@ func (f *File) ReadDown(version uint) (r io.ReadCloser, identifier string, err e
}
return r, m.Identifier, nil
}
return nil, "", &os.PathError{fmt.Sprintf("read version %v", version), f.path, os.ErrNotExist}
return nil, "", &os.PathError{Op: fmt.Sprintf("read version %v", version), Path: f.path, Err: os.ErrNotExist}
}

0 comments on commit c984265

Please sign in to comment.