From e5f61e22e9bc60e4adb3a9fb8c6a73f9c2ae54c8 Mon Sep 17 00:00:00 2001 From: bump Date: Wed, 16 Mar 2022 16:07:13 +0000 Subject: [PATCH] Update github-go-version from 1.17.7, 1.17.7, 1.17.7 to 1.18.0 Replace strings.Title and and fix deprecation warning --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release.yml | 2 +- format/matroska/ebml/gen/main.go | 9 ++++++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46e8a9594..3233e6a88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/setup-go@v3 with: - go-version: 1.17.7 + go-version: 1.18.0 - uses: actions/checkout@v3 - uses: golangci/golangci-lint-action@v3 with: @@ -47,7 +47,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.17.7 + go-version: 1.18.0 - name: Test env: GOARCH: ${{ matrix.goarch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 34ac781b8..2badd1050 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: 1.17.7 + go-version: 1.18.0 - uses: goreleaser/goreleaser-action@v2 with: distribution: goreleaser diff --git a/format/matroska/ebml/gen/main.go b/format/matroska/ebml/gen/main.go index 5f07bf45c..5e8a24108 100644 --- a/format/matroska/ebml/gen/main.go +++ b/format/matroska/ebml/gen/main.go @@ -69,6 +69,13 @@ func findDefintion(docs []Documentation) (string, bool) { return "", false } +func title(s string) string { + if len(s) <= 1 { + return s + } + return strings.ToUpper(s[0:1]) + s[1:] +} + func main() { xmlPath := os.Args[1] r, err := os.Open(xmlPath) @@ -135,7 +142,7 @@ func main() { if defOk { fmt.Printf("\t\tDefinition: %q,\n", def) } - fmt.Printf("\t\tType: ebml.%s%s,\n", strings.Title(typ), extra) + fmt.Printf("\t\tType: ebml.%s%s,\n", title(typ), extra) if len(c.Enums) > 0 { switch c.Type { case "integer":