Skip to content

Commit

Permalink
doc: fix go dev example code for FromSlicePtrOr
Browse files Browse the repository at this point in the history
  • Loading branch information
sunjayaali committed Oct 20, 2024
1 parent 407b62d commit 16fac06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2759,7 +2759,7 @@ Returns a slice with the pointer values or the fallback value.
str1 := "hello"
str2 := "world"

ptr := lo.FromSlicePtrOr([]*string{&str1, nil, &str2}, "fallback value")
ptr := lo.FromSlicePtrOr([]*string{&str1, &str2, nil}, "fallback value")
// []string{"hello", "world", "fallback value"}
```

Expand Down

0 comments on commit 16fac06

Please sign in to comment.