gogio: replace deprecated calls

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2024-01-09 14:51:45 -05:00
parent cb72b91a92
commit 7a117566ca
6 changed files with 28 additions and 25 deletions
+8
View File
@@ -9,6 +9,8 @@ import (
"path/filepath"
"runtime"
"strings"
"unicode"
"unicode/utf8"
)
type buildInfo struct {
@@ -74,6 +76,12 @@ func newBuildInfo(pkgPath string) (*buildInfo, error) {
return bi, nil
}
// UppercaseName returns a string with its first rune in uppercase.
func UppercaseName(name string) string {
ch, w := utf8.DecodeRuneInString(name)
return string(unicode.ToUpper(ch)) + name[w:]
}
func (s Semver) String() string {
return fmt.Sprintf("%d.%d.%d", s.Major, s.Minor, s.Patch)
}