From cdf41938b02f762759934514a11922c422dbf5fe Mon Sep 17 00:00:00 2001 From: Clayton Craft Date: Mon, 30 May 2022 23:23:43 -0700 Subject: [PATCH] deviceinfo: Don't use deprecated strings.Title (MR 20) This is a janky way to capitalize the first letter of the word. strings.Title was kind of overkill anyways I guess, since the reason for its deprecation wasn't even anything we'd hit in our usage of it (unable to detect some unicode punctuation for word boundaries... which a deviceinfo field wouldn't have anyways...) fixes #12 --- pkgs/deviceinfo/deviceinfo.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/deviceinfo/deviceinfo.go b/pkgs/deviceinfo/deviceinfo.go index 44766b0..90ca8fd 100644 --- a/pkgs/deviceinfo/deviceinfo.go +++ b/pkgs/deviceinfo/deviceinfo.go @@ -120,7 +120,10 @@ func nameToField(name string) string { if p == "deviceinfo" { continue } - field = field + strings.Title(p) + if len(p) < 1 { + continue + } + field = field + strings.ToUpper(p[:1]) + p[1:] } return field