Skip to content

Commit

Permalink
fix(diag): Diagnostics no longer attempts to append if supplied dia…
Browse files Browse the repository at this point in the history
…gs are empty.
  • Loading branch information
matthewhartstonge committed Jun 3, 2024
1 parent 87723d4 commit 4306601
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions diag/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ type Diagnostics []Diagnostic

// Append adds a number of new diagnostic entries to the diagnostics.
func (d *Diagnostics) Append(diags ...Diagnostic) {
if len(diags) == 0 {
// Nothing to append!
return
}

*d = append(*d, diags...)
}

Expand Down

0 comments on commit 4306601

Please sign in to comment.