Skip to content

Commit

Permalink
Enable Go 1.18 in the ci and release workflows
Browse files Browse the repository at this point in the history
* Enable Go 1.18 in the ci and release workflows

* Fix lint warning

* Add golangci as a make target
  • Loading branch information
ccojocar authored Mar 21, 2022
1 parent b99b5f7 commit 607d607
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
go_version:
- '1.16'
- '1.17'
- '1.18'
runs-on: ubuntu-latest
env:
GO111MODULE: on
Expand Down Expand Up @@ -44,7 +45,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
- name: Checkout Source
uses: actions/checkout@v3
- uses: actions/cache@v2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.18
- name: Install Cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.5.2'
cosign-release: 'v1.6.0'
- name: Store Cosign private key in a file
run: 'echo "$COSIGN_KEY" > /tmp/cosign.key'
shell: bash
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
tags: ${{steps.meta.outputs.tags}}
labels: ${{steps.meta.outputs.labels}}
push: true
build-args: GO_VERSION=1.17
build-args: GO_VERSION=1.18
- name: Sign Docker Image
run: cosign sign -key /tmp/cosign.key ${TAGS}
env:
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GOBIN ?= $(GOPATH)/bin
GOLINT ?= $(GOBIN)/golint
GOSEC ?= $(GOBIN)/gosec
GINKGO ?= $(GOBIN)/ginkgo
GO_VERSION = 1.17
GO_VERSION = 1.18

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

lint:
@echo "LINTING"
@echo "LINTING: golint"
$(GO_NOMOD) get -u golang.org/x/lint/golint
$(GOLINT) -set_exit_status ./...
@echo "VETTING"
$(GO) vet ./...

golangci:
@echo "LINTING: golangci-lint"
golangci-lint run

sec:
@echo "SECURITY SCANNING"
./$(BIN) ./...
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
//go:build go1.14 || !go1.11
// +build go1.14 !go1.11

// main
package main

import (
Expand Down
34 changes: 0 additions & 34 deletions cmd/tlsconfig/tls_version_go12_go13.go

This file was deleted.

9 changes: 4 additions & 5 deletions cmd/tlsconfig/tlsconfig.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
//go:build go1.12
// +build go1.12

package main

import (
Expand All @@ -14,9 +11,10 @@ import (
"log"
"net/http"
"path/filepath"
"strings"

"github.com/mozilla/tls-observatory/constants"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)

var (
Expand Down Expand Up @@ -82,7 +80,8 @@ func getTLSConfFromURL(url string) (*ServerSideTLSJson, error) {
}

func getGoCipherConfig(name string, sstls ServerSideTLSJson) (goCipherConfiguration, error) {
cipherConf := goCipherConfiguration{Name: strings.Title(name)}
caser := cases.Title(language.English)
cipherConf := goCipherConfiguration{Name: caser.String(name)}
conf, ok := sstls.Configurations[name]
if !ok {
return cipherConf, fmt.Errorf("TLS configuration '%s' not found", name)
Expand Down

0 comments on commit 607d607

Please sign in to comment.