mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-07 14:12:28 +08:00
fix: fix issue for PR #334, usge Pair struct to instance enum items
This commit is contained in:
@@ -3,9 +3,9 @@ package enum
|
||||
import "fmt"
|
||||
|
||||
func ExampleNewItem() {
|
||||
items := NewItems[Status](
|
||||
Active, "Active",
|
||||
Inactive, "Inactive",
|
||||
items := NewItems(
|
||||
Pair[Status]{Value: Active, Name: "Active"},
|
||||
Pair[Status]{Value: Inactive, Name: "Inactive"},
|
||||
)
|
||||
|
||||
fmt.Println(items[0].Name(), items[0].Value())
|
||||
|
||||
Reference in New Issue
Block a user