mirror of
https://git.sr.ht/~eliasnaur/gio-cmd
synced 2026-07-07 10:25:33 +00:00
gogio: replace deprecated calls
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user