func populateProposal()

in pkg/proposal/create.go [123:169]


func populateProposal(p *api.Proposal, opts *CreateOpts) {
	p.Name = opts.Name

	if opts.State != "" {
		p.Status = api.Status(opts.State)
	}

	now := time.Now()
	layout := "2006-01-02"

	p.CreationDate = now.Format(layout)
	p.Number = opts.Number
	p.Title = opts.Title

	if len(opts.Authors) > 0 {
		authors := []string{}
		for _, author := range opts.Authors {
			if !strings.HasPrefix(author, "@") {
				author = fmt.Sprintf("@%s", author)
			}

			authors = append(authors, author)
		}

		p.Authors = authors
	}

	if len(opts.Approvers) > 0 {
		p.Approvers = updatePersonReference(opts.Approvers)
	}

	if len(opts.Reviewers) > 0 {
		p.Reviewers = updatePersonReference(opts.Reviewers)
	}

	p.OwningSIG = opts.SIG

	// TODO(lint): appendAssign: append result not assigned to the same slice (gocritic)
	//nolint:gocritic
	p.ParticipatingSIGs = append(opts.ParticipatingSIGs, opts.SIG)
	p.Filename = opts.Name
	p.LastUpdated = "v1.19"

	if len(opts.PRRApprovers) > 0 {
		p.PRRApprovers = updatePersonReference(opts.PRRApprovers)
	}
}