Skip to content

Commit

Permalink
Refactor: Extract method: oscalIdToOpencontrol
Browse files Browse the repository at this point in the history
  • Loading branch information
isimluk committed Oct 5, 2020
1 parent 7fe5170 commit c1a8079
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/opencontrol/standard.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (std *Standard) SaveToFile(filename string) error {
}

func (controls Controls) Add(ctrl *catalog.Control, family string) {
controls[strings.ToUpper(ctrl.Id)] = Control{
controls[oscalIdToOpencontrol(ctrl.Id)] = Control{
Family: family,
Name: string(ctrl.Title),
Description: "TODO",
Expand All @@ -62,3 +62,7 @@ func (controls Controls) Add(ctrl *catalog.Control, family string) {
controls.Add(&child, family)
}
}

func oscalIdToOpencontrol(id string) string {
return strings.ToUpper(id)
}

0 comments on commit c1a8079

Please sign in to comment.