Skip to content

Commit

Permalink
refactor: migrates to new diag apis.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewhartstonge committed Nov 28, 2024
1 parent b4931a5 commit a2b4e42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions _example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func main() {

// Our diagnostics can be read to see every little step taken, file read and
// what wasn't able to parse.
if diags != nil {
fmt.Printf("\nConfiguration diagnostics:\n%s\n\n", diags)
if diags.Len() > 0 {
fmt.Printf("\nConfiguration diagnostics:\n%s\n\n", diags.All())
}

// If we want to read the underlying processed values for every file, envvar
Expand Down
2 changes: 1 addition & 1 deletion configurator.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func (c *Config) processConfig(diags diag.Diagnostics, component diag.Component,

c.appendParsedConfig(component, path, configurer.Values())

diags.Append(configurer.Validate(component)...)
diags.Merge(configurer.Validate(component))

c.Domain = configurer.Merge(c.Domain)

Expand Down

0 comments on commit a2b4e42

Please sign in to comment.