Refactor to use more Go 1.22 features

This commit is contained in:
Deluan
2024-05-12 20:04:11 -04:00
parent 9ee63b39cb
commit 6f2643e55e
3 changed files with 6 additions and 37 deletions
-14
View File
@@ -43,20 +43,6 @@ var _ = Describe("GG", func() {
)
})
Describe("FirstOr", func() {
Context("when given a list of strings", func() {
It("returns the first non-empty value", func() {
Expect(gg.FirstOr("default", "foo", "bar", "baz")).To(Equal("foo"))
Expect(gg.FirstOr("default", "", "", "qux")).To(Equal("qux"))
})
It("returns the default value if all values are empty", func() {
Expect(gg.FirstOr("default", "", "", "")).To(Equal("default"))
Expect(gg.FirstOr("", "", "", "")).To(Equal(""))
})
})
})
Describe("P", func() {
It("returns a pointer to the input value", func() {
v := 123