From 14261a8f0769b979ca0aad4e9c485a046748bdbe Mon Sep 17 00:00:00 2001 From: Dan Markham Date: Sun, 5 May 2019 15:07:38 -0700 Subject: [PATCH] Doc updates around String(s string) Case Insensitive --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7560c57..f558f22 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ When Enumer is applied to a type, it will generate: - Function `String(s string)`: returns the enum value from its string representation. This is useful when you need to read enum values from command line arguments, from a configuration file, or from a REST API request... In short, from those places where using the real enum value (an integer) would - be almost meaningless or hard to trace or use by a human. + be almost meaningless or hard to trace or use by a human. `s` string is Case Insensitive. - Function `Values()`: returns a slice with all the values of the enum - Function `Strings()`: returns a slice with all the Strings of the enum - Method `IsA()`: returns true only if the current value is among the values of the enum. Useful for validations. @@ -124,7 +124,7 @@ var aspirinString string = Aspirin.String() fmt.Println("I need ", Paracetamol) // Will print "I need Paracetamol" // Convert a string with the enum name to the corresponding enum value -pill, err := PillString("Ibuprofen") +pill, err := PillString("Ibuprofen") // "ibuprofen" will also work. if err != nil { fmt.Println("Unrecognized pill: ", err) return