3
0

upd(style): go-critic fixes

This commit is contained in:
Tit Petric
2018-08-03 17:17:16 +02:00
parent 01d8ba54a4
commit b8e1cd83cc
2 changed files with 11 additions and 11 deletions
+8 -8
View File
@@ -216,7 +216,7 @@ func (svc channel) Update(ctx context.Context, in *types.Channel) (out *types.Ch
})
}
func (svc channel) Delete(ctx context.Context, ID uint64) error {
func (svc channel) Delete(ctx context.Context, id uint64) error {
return svc.rpo.BeginWith(ctx, func(r repository.Interfaces) (err error) {
var ch *types.Channel
@@ -229,11 +229,11 @@ func (svc channel) Delete(ctx context.Context, ID uint64) error {
_, err = r.CreateMessage(svc.makeSystemMessage(ch,
"%s deleted this channel"))
return r.DeleteChannelByID(ID)
return r.DeleteChannelByID(id)
})
}
func (svc channel) Recover(ctx context.Context, ID uint64) error {
func (svc channel) Recover(ctx context.Context, id uint64) error {
return svc.rpo.BeginWith(ctx, func(r repository.Interfaces) (err error) {
var ch *types.Channel
@@ -246,11 +246,11 @@ func (svc channel) Recover(ctx context.Context, ID uint64) error {
_, err = r.CreateMessage(svc.makeSystemMessage(ch,
"%s recovered this channel"))
return r.DeleteChannelByID(ID)
return r.DeleteChannelByID(id)
})
}
func (svc channel) Archive(ctx context.Context, ID uint64) error {
func (svc channel) Archive(ctx context.Context, id uint64) error {
return svc.rpo.BeginWith(ctx, func(r repository.Interfaces) (err error) {
var ch *types.Channel
@@ -263,11 +263,11 @@ func (svc channel) Archive(ctx context.Context, ID uint64) error {
_, err = r.CreateMessage(svc.makeSystemMessage(ch,
"%s archived this channel"))
return r.ArchiveChannelByID(ID)
return r.ArchiveChannelByID(id)
})
}
func (svc channel) Unarchive(ctx context.Context, ID uint64) error {
func (svc channel) Unarchive(ctx context.Context, id uint64) error {
return svc.rpo.BeginWith(ctx, func(r repository.Interfaces) (err error) {
var ch *types.Channel
@@ -280,7 +280,7 @@ func (svc channel) Unarchive(ctx context.Context, ID uint64) error {
_, err = r.CreateMessage(svc.makeSystemMessage(ch,
"%s unarchived this channel"))
return r.ArchiveChannelByID(ID)
return r.ArchiveChannelByID(id)
})
}
+3 -3
View File
@@ -53,10 +53,10 @@ func (svc user) Find(ctx context.Context, filter *types.UserFilter) ([]*types.Us
return svc.rpo.FindUsers(filter)
}
func (svc user) Create(ctx context.Context, input *types.User) (new *types.User, err error) {
func (svc user) Create(ctx context.Context, input *types.User) (user *types.User, err error) {
// no real need for tx here, just presenting the capabilities
return new, svc.rpo.BeginWith(ctx, func(r repository.Interfaces) error {
if new, err = r.CreateUser(input); err != nil {
return user, svc.rpo.BeginWith(ctx, func(r repository.Interfaces) error {
if user, err = r.CreateUser(input); err != nil {
return err
}