mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2026-01-05 18:53:15 -06:00
review changes
This commit is contained in:
parent
61149178c8
commit
2f44633cde
4 changed files with 39 additions and 39 deletions
|
|
@ -34,12 +34,12 @@ func (i *importer) Import(ctx context.Context, path string) error {
|
|||
return errors.New("Export: path empty")
|
||||
}
|
||||
|
||||
f, err := os.Open(path)
|
||||
file, err := os.Open(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Import: couldn't export to %s: %s", path, err)
|
||||
}
|
||||
|
||||
decoder := json.NewDecoder(f)
|
||||
decoder := json.NewDecoder(file)
|
||||
decoder.UseNumber()
|
||||
|
||||
for {
|
||||
|
|
@ -48,7 +48,7 @@ func (i *importer) Import(ctx context.Context, path string) error {
|
|||
if err != nil {
|
||||
if err == io.EOF {
|
||||
i.log.Infof("Import: reached end of file")
|
||||
return neatClose(f)
|
||||
return neatClose(file)
|
||||
}
|
||||
return fmt.Errorf("Import: error decoding in readLoop: %s", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue