From cd889572f7870a62758240b323a9086a76c5120a Mon Sep 17 00:00:00 2001 From: Josh Bialkowski Date: Fri, 22 Nov 2019 22:34:19 -0800 Subject: codereview #2: some cleanup, correct use of nothing-events * return error, don't panic * skipping status export is an error * use switch in config.go * move PromptPassword to input * move client construction into getIdentityClient * use non-pointer context throughout client since it is an interface * remove some TODOs * don't emit multiple nothing-events, just one per bug only if nothing happened. * rename EditBody to EditCreateComment * add configuration notes about additional values * store bug id map in a dictionary in the config * some fixes from testing --- cache/bug_cache.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cache') diff --git a/cache/bug_cache.go b/cache/bug_cache.go index 965ebe94..b86b31e0 100644 --- a/cache/bug_cache.go +++ b/cache/bug_cache.go @@ -210,17 +210,17 @@ func (c *BugCache) SetTitleRaw(author *IdentityCache, unixTime int64, title stri return op, c.notifyUpdated() } -func (c *BugCache) EditBody(body string) (*bug.EditCommentOperation, error) { +func (c *BugCache) EditCreateComment(body string) (*bug.EditCommentOperation, error) { author, err := c.repoCache.GetUserIdentity() if err != nil { return nil, err } - return c.EditBodyRaw(author, time.Now().Unix(), body, nil) + return c.EditCreateCommentRaw(author, time.Now().Unix(), body, nil) } -func (c *BugCache) EditBodyRaw(author *IdentityCache, unixTime int64, body string, metadata map[string]string) (*bug.EditCommentOperation, error) { - op, err := bug.EditBody(c.bug, author.Identity, unixTime, body) +func (c *BugCache) EditCreateCommentRaw(author *IdentityCache, unixTime int64, body string, metadata map[string]string) (*bug.EditCommentOperation, error) { + op, err := bug.EditCreateComment(c.bug, author.Identity, unixTime, body) if err != nil { return nil, err } -- cgit