Skip to content

Commit 607d607

Browse files
authored
Enable Go 1.18 in the ci and release workflows
* Enable Go 1.18 in the ci and release workflows * Fix lint warning * Add golangci as a make target
1 parent b99b5f7 commit 607d607

File tree

6 files changed

+15
-49
lines changed

6 files changed

+15
-49
lines changed

.github/workflows/ci.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ jobs:
1313
go_version:
1414
- '1.16'
1515
- '1.17'
16+
- '1.18'
1617
runs-on: ubuntu-latest
1718
env:
1819
GO111MODULE: on
@@ -44,7 +45,7 @@ jobs:
4445
- name: Setup go
4546
uses: actions/setup-go@v3
4647
with:
47-
go-version: '1.17'
48+
go-version: '1.18'
4849
- name: Checkout Source
4950
uses: actions/checkout@v3
5051
- uses: actions/cache@v2

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
- name: Set up Go
1818
uses: actions/setup-go@v3
1919
with:
20-
go-version: 1.17
20+
go-version: 1.18
2121
- name: Install Cosign
2222
uses: sigstore/cosign-installer@main
2323
with:
24-
cosign-release: 'v1.5.2'
24+
cosign-release: 'v1.6.0'
2525
- name: Store Cosign private key in a file
2626
run: 'echo "$COSIGN_KEY" > /tmp/cosign.key'
2727
shell: bash
@@ -66,7 +66,7 @@ jobs:
6666
tags: ${{steps.meta.outputs.tags}}
6767
labels: ${{steps.meta.outputs.labels}}
6868
push: true
69-
build-args: GO_VERSION=1.17
69+
build-args: GO_VERSION=1.18
7070
- name: Sign Docker Image
7171
run: cosign sign -key /tmp/cosign.key ${TAGS}
7272
env:

Makefile

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ GOBIN ?= $(GOPATH)/bin
1212
GOLINT ?= $(GOBIN)/golint
1313
GOSEC ?= $(GOBIN)/gosec
1414
GINKGO ?= $(GOBIN)/ginkgo
15-
GO_VERSION = 1.17
15+
GO_VERSION = 1.18
1616

1717
default:
1818
$(MAKE) build
@@ -31,12 +31,16 @@ fmt:
3131
@([ ! -z "$(FORMATTED)" ] && printf "Fixed unformatted files:\n$(FORMATTED)") || true
3232

3333
lint:
34-
@echo "LINTING"
34+
@echo "LINTING: golint"
3535
$(GO_NOMOD) get -u golang.org/x/lint/golint
3636
$(GOLINT) -set_exit_status ./...
3737
@echo "VETTING"
3838
$(GO) vet ./...
3939

40+
golangci:
41+
@echo "LINTING: golangci-lint"
42+
golangci-lint run
43+
4044
sec:
4145
@echo "SECURITY SCANNING"
4246
./$(BIN) ./...

cmd/tlsconfig/tls_version_go14.go renamed to cmd/tlsconfig/tls_version.go

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
//go:build go1.14 || !go1.11
2-
// +build go1.14 !go1.11
3-
4-
// main
51
package main
62

73
import (

cmd/tlsconfig/tls_version_go12_go13.go

-34
This file was deleted.

cmd/tlsconfig/tlsconfig.go

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
//go:build go1.12
2-
// +build go1.12
3-
41
package main
52

63
import (
@@ -14,9 +11,10 @@ import (
1411
"log"
1512
"net/http"
1613
"path/filepath"
17-
"strings"
1814

1915
"github.com/mozilla/tls-observatory/constants"
16+
"golang.org/x/text/cases"
17+
"golang.org/x/text/language"
2018
)
2119

2220
var (
@@ -82,7 +80,8 @@ func getTLSConfFromURL(url string) (*ServerSideTLSJson, error) {
8280
}
8381

8482
func getGoCipherConfig(name string, sstls ServerSideTLSJson) (goCipherConfiguration, error) {
85-
cipherConf := goCipherConfiguration{Name: strings.Title(name)}
83+
caser := cases.Title(language.English)
84+
cipherConf := goCipherConfiguration{Name: caser.String(name)}
8685
conf, ok := sstls.Configurations[name]
8786
if !ok {
8887
return cipherConf, fmt.Errorf("TLS configuration '%s' not found", name)

0 commit comments

Comments
 (0)