Skip to content

Commit

Permalink
lint: fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowalski committed Nov 8, 2018
1 parent a673d36 commit b8ecd1d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -13,7 +13,7 @@ require (
go.opencensus.io v0.18.0 // indirect
golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16
golang.org/x/exp v0.0.0-20181022080537-42ba7d4b6eb2
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc // indirect
golang.org/x/net v0.0.0-20181102091132-c10e9556a7bc
golang.org/x/oauth2 v0.0.0-20181102170140-232e45548389
golang.org/x/sys v0.0.0-20181031143558-9b800f95dbbc // indirect
google.golang.org/api v0.0.0-20181102150758-04bb50b6b83d
Expand Down
6 changes: 3 additions & 3 deletions initialize.go
Expand Up @@ -54,15 +54,15 @@ func Initialize(ctx context.Context, st storage.Storage, opt *NewRepositoryOptio
format := formatBlockFromOptions(opt)
masterKey, err := format.deriveMasterKeyFromPassword(password)
if err != nil {
return err
return fmt.Errorf("unable to derive master key: %v", err)
}

if err := encryptFormatBytes(format, repositoryObjectFormatFromOptions(opt), masterKey, format.UniqueID); err != nil {
return err
return fmt.Errorf("unable to encrypt format bytes: %v", err)
}

if err := writeFormatBlock(ctx, st, format); err != nil {
return err
return fmt.Errorf("unable to write format block: %v", err)
}

return nil
Expand Down
8 changes: 4 additions & 4 deletions repository.go
Expand Up @@ -26,16 +26,16 @@ type Repository struct {
// Close closes the repository and releases all resources.
func (r *Repository) Close(ctx context.Context) error {
if err := r.Manifests.Flush(ctx); err != nil {
return err
return fmt.Errorf("error flushing manifests: %v", err)
}
if err := r.Objects.Close(ctx); err != nil {
return err
return fmt.Errorf("error closing objects: %v", err)
}
if err := r.Blocks.Flush(ctx); err != nil {
return err
return fmt.Errorf("error closing blocks: %v", err)
}
if err := r.Storage.Close(ctx); err != nil {
return err
return fmt.Errorf("error closing storage: %v", err)
}
return nil
}
Expand Down

0 comments on commit b8ecd1d

Please sign in to comment.