build: updates for go1.17 (#769)

* build: remove `GO111MODULE` as it turned on by default

Signed-off-by: Rui Chen <rui@chenrui.dev>

* build: update for go1.17

* run test

Signed-off-by: Rui Chen <rui@chenrui.dev>

* lint: remove unused code
This commit is contained in:
rui authored and GitHub committed 2022-02-22 16:49:45 -06:00
1 parent fbfb3f591e
commit 4b6f4d0de5
7 files changed
+22 -20

No files matched your search

-4
View File
@@ -11,8 +11,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
@@ -26,8 +24,6 @@ jobs:
test:
runs-on: ubuntu-latest
env:
GO111MODULE: on
steps:
- uses: actions/checkout@v2
+1 -1
View File
@@ -2,7 +2,7 @@ FROM golang:1.17 AS build
WORKDIR /go/src/github.com/zricethezav/gitleaks
COPY . .
RUN VERSION=$(git describe --tags --abbrev=0) && \
GO111MODULE=on CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
CGO_ENABLED=0 go build -o bin/gitleaks -ldflags "-X="github.com/zricethezav/gitleaks/v8/cmd.Version=${VERSION}
FROM alpine:3.14.2
RUN adduser -D gitleaks && \
+21 -2
View File
@@ -1,6 +1,6 @@
module github.com/zricethezav/gitleaks/v8
go 1.16
go 1.17
require (
github.com/gitleaks/go-gitdiff v0.7.4
@@ -9,7 +9,26 @@ require (
github.com/spf13/viper v1.8.1
github.com/stretchr/testify v1.7.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
)
require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/magiconair/properties v1.8.5 // indirect
github.com/mitchellh/mapstructure v1.4.1 // indirect
github.com/pelletier/go-toml v1.9.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/spf13/afero v1.6.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/sys v0.0.0-20211110154304-99a53858aa08 // indirect
golang.org/x/tools v0.1.5
golang.org/x/text v0.3.5 // indirect
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
-1
View File
@@ -467,7 +467,6 @@ golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4f
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA=
golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
-1
View File
@@ -2,4 +2,3 @@ package report
const version = "v8.0.0"
const driver = "gitleaks"
const driverURL = "https://github.com/zricethezav/gitleaks"
-11
View File
@@ -207,14 +207,3 @@ type Runs struct {
Tool Tool `json:"tool"`
Results []Results `json:"results"`
}
func configToRules(cfg config.Config) []Rules {
var rules []Rules
for _, rule := range cfg.Rules {
rules = append(rules, Rules{
ID: rule.RuleID,
Name: rule.Description,
})
}
return rules
}
Binary file not shown.