Skip to content

Commit

Permalink
Upgrade Go to 1.21 (kuskoman#183)
Browse files Browse the repository at this point in the history
* Upgrade go to version 1.21

* Update go version in CI pipeline

* Temporarily remove CodeQL workflow
  • Loading branch information
kuskoman authored Sep 30, 2023
1 parent 1b222af commit 0548a52
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 60 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/codeql.yml

This file was deleted.

10 changes: 5 additions & 5 deletions .github/workflows/go-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.20"
go-version: "^1.21"

- name: Lint code using golangci-lint
uses: golangci/golangci-lint-action@v3
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.20"
go-version: "^1.21"

- name: Test code
run: go test ./... -covermode=atomic -coverprofile=coverage.out
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.20"
go-version: "^1.21"

- name: Build Linux binary
run: make build-linux
Expand All @@ -174,7 +174,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.20"
go-version: "^1.21"

- name: Build Mac binary
run: make build-darwin
Expand All @@ -199,7 +199,7 @@ jobs:
- name: Setup Golang with cache
uses: magnetikonline/action-golang-cache@v4
with:
go-version: "^1.20"
go-version: "^1.21"

- name: Build Windows binary
run: make build-windows
Expand Down
2 changes: 1 addition & 1 deletion cmd/exporter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package main

import (
"log"
"log/slog"
"os"

"github.com/joho/godotenv"
"github.com/kuskoman/logstash-exporter/collectors"
"github.com/kuskoman/logstash-exporter/config"
"github.com/kuskoman/logstash-exporter/server"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/exp/slog"
)

func main() {
Expand Down
3 changes: 1 addition & 2 deletions collectors/collector_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ package collectors

import (
"context"
"log/slog"
"sync"
"time"

"golang.org/x/exp/slog"

"github.com/kuskoman/logstash-exporter/collectors/nodeinfo"
"github.com/kuskoman/logstash-exporter/collectors/nodestats"
"github.com/kuskoman/logstash-exporter/config"
Expand Down
6 changes: 2 additions & 4 deletions collectors/nodestats/pipeline_subcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ package nodestats

import (
"fmt"
"log/slog"
"time"

"golang.org/x/exp/slog"

"github.com/prometheus/client_golang/prometheus"

"github.com/kuskoman/logstash-exporter/fetcher/responses"
"github.com/kuskoman/logstash-exporter/prometheus_helper"
"github.com/prometheus/client_golang/prometheus"
)

const (
Expand Down
3 changes: 1 addition & 2 deletions config/slog_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ package config

import (
"fmt"
"log/slog"
"os"
"strings"

"golang.org/x/exp/slog"
)

var (
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module github.com/kuskoman/logstash-exporter

go 1.20
go 1.21

require (
github.com/joho/godotenv v1.5.1
github.com/prometheus/client_golang v1.17.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gkampitakis/ciinfo v0.2.4 h1:Ip1hf4K7ISRuVlDrheuhaeffg1VOhlyeFGaQ/vTxrtE=
github.com/gkampitakis/ciinfo v0.2.4/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo=
github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M=
Expand All @@ -16,6 +17,7 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand Down Expand Up @@ -46,8 +48,6 @@ github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY=
github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g=
golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Expand Down

0 comments on commit 0548a52

Please sign in to comment.