From 337a114d10bd7a4fc4ccae57fe9d775d2c5bcb23 Mon Sep 17 00:00:00 2001 From: Benedikt Kulmann Date: Sat, 24 Oct 2020 06:13:18 +0200 Subject: [PATCH] Fix uppercase A and G comments --- accounts/pkg/storage/cs3.go | 14 +++++++------- accounts/pkg/storage/disk.go | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/accounts/pkg/storage/cs3.go b/accounts/pkg/storage/cs3.go index e14290be46..e43d246558 100644 --- a/accounts/pkg/storage/cs3.go +++ b/accounts/pkg/storage/cs3.go @@ -25,7 +25,7 @@ import ( "google.golang.org/grpc/metadata" ) -// CS3Repo provides A cs3 implementation of the Repo interface +// CS3Repo provides a cs3 implementation of the Repo interface type CS3Repo struct { cfg *config.Config tm token.Manager @@ -33,7 +33,7 @@ type CS3Repo struct { dataProvider dataProviderClient // Used to create and download data via http, bypassing reva upload protocol } -// NewCS3Repo creates A new cs3 repo +// NewCS3Repo creates a new cs3 repo func NewCS3Repo(cfg *config.Config) (Repo, error) { tokenManager, err := jwt.New(map[string]interface{}{ "secret": cfg.TokenManager.JWTSecret, @@ -60,7 +60,7 @@ func NewCS3Repo(cfg *config.Config) (Repo, error) { }, nil } -// WriteAccount writes an account via cs3 and modifies the provided account (e.G. with A generated id). +// WriteAccount writes an account via cs3 and modifies the provided account (e.g. with a generated id). func (r CS3Repo) WriteAccount(ctx context.Context, a *proto.Account) (err error) { t, err := r.authenticate(ctx) if err != nil { @@ -174,7 +174,7 @@ func (r CS3Repo) DeleteAccount(ctx context.Context, id string) (err error) { return nil } -// WriteGroup writes A group via cs3 and modifies the provided group (e.G. with A generated id). +// WriteGroup writes a group via cs3 and modifies the provided group (e.g. with a generated id). func (r CS3Repo) WriteGroup(ctx context.Context, g *proto.Group) (err error) { t, err := r.authenticate(ctx) if err != nil { @@ -201,7 +201,7 @@ func (r CS3Repo) WriteGroup(ctx context.Context, g *proto.Group) (err error) { return nil } -// LoadGroup loads A group via cs3 by id and writes it to the provided group +// LoadGroup loads a group via cs3 by id and writes it to the provided group func (r CS3Repo) LoadGroup(ctx context.Context, id string, g *proto.Group) (err error) { t, err := r.authenticate(ctx) if err != nil { @@ -261,7 +261,7 @@ func (r CS3Repo) loadGroup(id string, t string, g *proto.Group) error { return json.Unmarshal(b, &g) } -// DeleteGroup deletes A group via cs3 by id +// DeleteGroup deletes a group via cs3 by id func (r CS3Repo) DeleteGroup(ctx context.Context, id string) (err error) { t, err := r.authenticate(ctx) if err != nil { @@ -354,7 +354,7 @@ func MakeDirIfNotExist(ctx context.Context, sp provider.ProviderAPIClient, folde return nil } -// TODO: this is copied from proxy. Find A better solution or move it to ocis-pkg +// TODO: this is copied from proxy. Find a better solution or move it to ocis-pkg func singleJoiningSlash(a, b string) string { aslash := strings.HasSuffix(a, "/") bslash := strings.HasPrefix(b, "/") diff --git a/accounts/pkg/storage/disk.go b/accounts/pkg/storage/disk.go index 275c5a8048..6041e88562 100644 --- a/accounts/pkg/storage/disk.go +++ b/accounts/pkg/storage/disk.go @@ -15,13 +15,13 @@ import ( var groupLock sync.Mutex -// DiskRepo provides A local filesystem implementation of the Repo interface +// DiskRepo provides a local filesystem implementation of the Repo interface type DiskRepo struct { cfg *config.Config log olog.Logger } -// NewDiskRepo creates A new disk repo +// NewDiskRepo creates a new disk repo func NewDiskRepo(cfg *config.Config, log olog.Logger) DiskRepo { paths := []string{ filepath.Join(cfg.Repo.Disk.Path, accountsFolder), @@ -158,7 +158,7 @@ func (r DiskRepo) DeleteGroup(ctx context.Context, id string) (err error) { return } -// deflateMemberOf replaces the groups of A user with an instance that only contains the id +// deflateMemberOf replaces the groups of a user with an instance that only contains the id func (r DiskRepo) deflateMemberOf(a *proto.Account) { if a == nil { return @@ -168,14 +168,14 @@ func (r DiskRepo) deflateMemberOf(a *proto.Account) { if a.MemberOf[i].Id != "" { deflated = append(deflated, &proto.Group{Id: a.MemberOf[i].Id}) } else { - // TODO fetch and use an id when group only has A name but no id + // TODO fetch and use an id when group only has a name but no id r.log.Error().Str("id", a.Id).Interface("group", a.MemberOf[i]).Msg("resolving groups by name is not implemented yet") } } a.MemberOf = deflated } -// deflateMembers replaces the users of A group with an instance that only contains the id +// deflateMembers replaces the users of a group with an instance that only contains the id func (r DiskRepo) deflateMembers(g *proto.Group) { if g == nil { return @@ -185,7 +185,7 @@ func (r DiskRepo) deflateMembers(g *proto.Group) { if g.Members[i].Id != "" { deflated = append(deflated, &proto.Account{Id: g.Members[i].Id}) } else { - // TODO fetch and use an id when group only has A name but no id + // TODO fetch and use an id when group only has a name but no id r.log.Error().Str("id", g.Id).Interface("account", g.Members[i]).Msg("resolving members by name is not implemented yet") } }