Someone replied off-list and suggested using the cases.NoLower option while initializing the Caser. And it worked! Thanks!
On Wednesday, March 30, 2022 at 10:15:40 AM UTC-6 Kevin Chowski wrote: > I guess "Better" is not really what I mean... maybe more accurately I need > something "closer" to strings.Title. > > On Wednesday, March 30, 2022 at 9:59:24 AM UTC-6 Kevin Chowski wrote: > >> strings.Title is newly deprecated >> <https://tip.golang.org/doc/go1.18#:~:text=10%20times%20faster.-,The%20Title%20function%20is%20now%20deprecated.%20It%20doesn't%20handle%20Unicode%20punctuation%20and%20language-specific%20capitalization%20rules,%20and%20is%20superseded%20by%20the%20golang.org/x/text/cases%20package.,-sync>, >> >> but unfortunately the suggested replacement (golang.org/x/text/cases) >> doesn't seem to be equivalent for my usecase. At least, I can't figure out >> how to make it equivalent :) >> >> Specifically, I wrote some code that relies on converting a string like >> "myInput" into "MyInput", which is what strings.Title does. Unfortunately, >> the cases package seems to turn it into "Myinput": >> https://go.dev/play/p/yucD99ytNK7 . I've tried a few different >> language.Tag values but nothing seems to work the way I need it to work. >> >> Will I have to just keep using this old version, or is there a way to get >> the new library working the way I need it to work? >> >> Thanks again in advance for the advice, >> Kevin >> > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3ba30f22-9a16-4d80-b977-e0abe6ca3362n%40googlegroups.com.