Skip to content

Commit

Permalink
Move function to method on system artifacts
Browse files Browse the repository at this point in the history
We can test nil-ness inside the method.
  • Loading branch information
cpuguy83 committed Jun 28, 2024
1 parent 3c223e2 commit 2276f8f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions frontend/rpm/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ func (w *specWrapper) BuildSteps() fmt.Stringer {
func (w *specWrapper) PreUn() fmt.Stringer {
b := &strings.Builder{}

if dalec.SystemdIsEmpty(w.Artifacts.Systemd) {
if w.Artifacts.Systemd.IsEmpty() {
return b
}

Expand All @@ -311,7 +311,7 @@ func (w *specWrapper) PreUn() fmt.Stringer {
func (w *specWrapper) Post() fmt.Stringer {
b := &strings.Builder{}

if dalec.SystemdIsEmpty(w.Artifacts.Systemd) {
if w.Artifacts.Systemd.IsEmpty() {
return b
}

Expand All @@ -330,7 +330,7 @@ func (w *specWrapper) Post() fmt.Stringer {
func (w *specWrapper) PostUn() fmt.Stringer {
b := &strings.Builder{}

if dalec.SystemdIsEmpty(w.Artifacts.Systemd) {
if w.Artifacts.Systemd.IsEmpty() {
return b
}

Expand Down
2 changes: 1 addition & 1 deletion spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ func (c *CheckOutputError) Error() string {
return fmt.Sprintf("expected %q %s %q, got %q", c.Path, c.Kind, c.Expected, c.Actual)
}

func SystemdIsEmpty(s *SystemdConfiguration) bool {
func (s *SystemdConfiguration) IsEmpty() bool {
if s == nil {
return true
}
Expand Down

0 comments on commit 2276f8f

Please sign in to comment.