Skip to content

Commit 136c34b

Browse files
authored
Upgrade to Go 1.19 (#208)
* Bump go version 1.19 Signed-off-by: Caleb Brown <[email protected]> * Update the Go base image to 1.19.1 linux/amd64 Signed-off-by: Caleb Brown <[email protected]> * Migrate to flag.TextVar in Go 1.19 Signed-off-by: Caleb Brown <[email protected]> * Remove backport of textvarflag because we are now on Go 1.19. Signed-off-by: Caleb Brown <[email protected]> Signed-off-by: Caleb Brown <[email protected]>
1 parent b9199a2 commit 136c34b

File tree

8 files changed

+8
-164
lines changed

8 files changed

+8
-164
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
1616
- uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
1717
with:
18-
go-version: 1.18
18+
go-version: 1.19
1919
- name: Run tests
2020
run: make test
2121
run-linter:
@@ -24,6 +24,6 @@ jobs:
2424
- uses: actions/checkout@a12a3943b4bdde767164f792f33f40b04645d846
2525
- uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
2626
with:
27-
go-version: 1.18
27+
go-version: 1.19
2828
- name: golangci-lint
2929
uses: golangci/golangci-lint-action@537aa1903e5d359d0b27dbc19ddd22c5087f3fbc

cmd/collect_signals/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import (
4141
"github.com/ossf/criticality_score/internal/githubapi"
4242
log "github.com/ossf/criticality_score/internal/log"
4343
"github.com/ossf/criticality_score/internal/outfile"
44-
"github.com/ossf/criticality_score/internal/textvarflag"
4544
"github.com/ossf/criticality_score/internal/workerpool"
4645
)
4746

@@ -58,7 +57,7 @@ var (
5857

5958
func init() {
6059
flag.Var(&logLevel, "log", "set the `level` of logging.")
61-
textvarflag.TextVar(flag.CommandLine, &logEnv, "log-env", log.DefaultEnv, "set logging `env`.")
60+
flag.TextVar(&logEnv, "log-env", log.DefaultEnv, "set logging `env`.")
6261
outfile.DefineFlags(flag.CommandLine, "force", "append", "OUT_FILE")
6362
flag.Usage = func() {
6463
cmdName := path.Base(os.Args[0])

cmd/enumerate_github/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM golang@sha256:684d791f8fd1b28485ee32239d92cde7099d97c88c5ed2e955f65f4adcf35d0f AS base
15+
FROM golang@sha256:122f3484f844467ebe0674cf57272e61981770eb0bc7d316d1f0be281a88229f AS base
1616
WORKDIR /src
1717
ENV CGO_ENABLED=0
1818
COPY go.mod go.sum ./

cmd/enumerate_github/main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import (
3737
"github.com/ossf/criticality_score/internal/envflag"
3838
log "github.com/ossf/criticality_score/internal/log"
3939
"github.com/ossf/criticality_score/internal/outfile"
40-
"github.com/ossf/criticality_score/internal/textvarflag"
4140
"github.com/ossf/criticality_score/internal/workerpool"
4241
)
4342

@@ -106,8 +105,8 @@ func init() {
106105
flag.Var(&startDateFlag, "start", "the start `date` to enumerate back to. Must be at or after 2008-01-01.")
107106
flag.Var(&endDateFlag, "end", "the end `date` to enumerate from.")
108107
flag.Var(&logLevel, "log", "set the `level` of logging.")
109-
textvarflag.TextVar(flag.CommandLine, &format, "format", repowriter.WriterTypeText, "set output file `format`.")
110-
textvarflag.TextVar(flag.CommandLine, &logEnv, "log-env", log.DefaultEnv, "set logging `env`.")
108+
flag.TextVar(&format, "format", repowriter.WriterTypeText, "set output file `format`.")
109+
flag.TextVar(&logEnv, "log-env", log.DefaultEnv, "set logging `env`.")
111110
outfile.DefineFlags(flag.CommandLine, "force", "append", "FILE")
112111
flag.Usage = func() {
113112
cmdName := path.Base(os.Args[0])

cmd/scorer/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import (
5151
_ "github.com/ossf/criticality_score/cmd/scorer/algorithm/wam"
5252
log "github.com/ossf/criticality_score/internal/log"
5353
"github.com/ossf/criticality_score/internal/outfile"
54-
"github.com/ossf/criticality_score/internal/textvarflag"
5554
)
5655

5756
const defaultLogLevel = zapcore.InfoLevel
@@ -65,7 +64,7 @@ var (
6564

6665
func init() {
6766
flag.Var(&logLevel, "log", "set the `level` of logging.")
68-
textvarflag.TextVar(flag.CommandLine, &logEnv, "log-env", log.DefaultEnv, "set logging `env`.")
67+
flag.TextVar(&logEnv, "log-env", log.DefaultEnv, "set logging `env`.")
6968
outfile.DefineFlags(flag.CommandLine, "force", "append", "OUT_FILE") // TODO: add the ability to disable "append"
7069
flag.Usage = func() {
7170
cmdName := path.Base(os.Args[0])

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/ossf/criticality_score
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
cloud.google.com/go/bigquery v1.32.0

internal/textvarflag/flag.go

Lines changed: 0 additions & 92 deletions
This file was deleted.

internal/textvarflag/flag_test.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

0 commit comments

Comments
 (0)