Skip to content

Commit

Permalink
Change demo code to use Validate instead of ΛValidate (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
wenovus authored Oct 17, 2022
1 parent 1d36b4a commit 7e512ef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions demo/getting_started/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
i.Description = ygot.String("An Interface")

// We can then validate the contents of the interface that we created.
if err := d.Interface["eth0"].ΛValidate(); err != nil {
if err := d.Interface["eth0"].Validate(); err != nil {
panic(fmt.Sprintf("Interface validation failed: %v", err))
}

Expand Down Expand Up @@ -115,14 +115,14 @@ func main() {
}
ygot.BuildEmptyTree(subif)
_, err = subif.Ipv4.NewAddress("Not a valid address")
if err := invalidIf.ΛValidate(); err == nil {
if err := invalidIf.Validate(); err == nil {
panic(fmt.Sprintf("Did not find invalid address, got nil err: %v", err))
} else {
fmt.Printf("Got expected error: %v\n", err)
}

// We can also validate the device overall.
if err := d.ΛValidate(); err != nil {
if err := d.Validate(); err != nil {
panic(fmt.Sprintf("Device validation failed: %v", err))
}

Expand Down

0 comments on commit 7e512ef

Please sign in to comment.