Rename titleBody (now a misnomer) to something more descriptive

This commit is contained in:
Mislav Marohnić 2020-05-08 17:55:46 +02:00
parent 72e99e9530
commit 716036161b
3 changed files with 5 additions and 5 deletions

View file

@ -418,7 +418,7 @@ func issueCreate(cmd *cobra.Command, args []string) error {
}
action := SubmitAction
tb := titleBody{
tb := issueMetadataState{
Assignees: assignees,
Labels: labelNames,
Projects: projectNames,

View file

@ -200,7 +200,7 @@ func prCreate(cmd *cobra.Command, _ []string) error {
}
}
tb := titleBody{
tb := issueMetadataState{
Reviewers: reviewers,
Assignees: assignees,
Labels: labelNames,

View file

@ -14,7 +14,7 @@ import (
type Action int
type titleBody struct {
type issueMetadataState struct {
Body string
Title string
Action Action
@ -29,7 +29,7 @@ type titleBody struct {
MetadataResult *api.RepoMetadataResult
}
func (tb *titleBody) HasMetadata() bool {
func (tb *issueMetadataState) HasMetadata() bool {
return len(tb.Reviewers) > 0 ||
len(tb.Assignees) > 0 ||
len(tb.Labels) > 0 ||
@ -125,7 +125,7 @@ func selectTemplate(templatePaths []string) (string, error) {
return string(templateContents), nil
}
func titleBodySurvey(cmd *cobra.Command, data *titleBody, apiClient *api.Client, repo ghrepo.Interface, providedTitle, providedBody string, defs defaults, templatePaths []string, allowReviewers bool) error {
func titleBodySurvey(cmd *cobra.Command, data *issueMetadataState, apiClient *api.Client, repo ghrepo.Interface, providedTitle, providedBody string, defs defaults, templatePaths []string, allowReviewers bool) error {
editorCommand := os.Getenv("GH_EDITOR")
if editorCommand == "" {
ctx := contextForCommand(cmd)