Skip to content

Commit d67cc30

Browse files
authored
Go 1.19 (#4)
1 parent 348b0cf commit d67cc30

File tree

10 files changed

+142
-108
lines changed

10 files changed

+142
-108
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,12 @@ jobs:
1111
name: CI
1212
runs-on: ubuntu-latest
1313
steps:
14+
- uses: actions/checkout@v3
1415

15-
- uses: actions/setup-go@v1
16+
- uses: actions/setup-go@v3
1617
with:
17-
go-version: 1.14
18-
19-
- uses: actions/checkout@v2
20-
21-
- uses: actions/cache@v1
22-
with:
23-
path: ~/go/pkg/mod
24-
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
25-
restore-keys: |
26-
${{ runner.os }}-go-
18+
cache: true
19+
go-version-file: "go.mod"
2720

2821
- name: Get dependencies
2922
run: go mod download

.github/workflows/release.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,22 @@ jobs:
1515
- platform: darwin
1616

1717
steps:
18-
- uses: actions/setup-go@v1
19-
with:
20-
go-version: 1.14
18+
- uses: actions/checkout@v3
2119

22-
- uses: actions/checkout@v2
20+
- uses: actions/setup-go@v3
21+
with:
22+
cache: true
23+
go-version-file: "go.mod"
2324

2425
- name: Get dependencies
2526
run: go mod download
2627

2728
- name: Build
2829
run: make ${{ matrix.platform }}
2930

30-
- name: Upload
31-
id: upload-release-asset
32-
uses: actions/upload-release-asset@v1
33-
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Upload binaries (${{ matrix.platform }})
32+
uses: AButler/upload-release-assets@v2.0.2
3533
with:
36-
upload_url: ${{ github.event.release.upload_url }}
37-
asset_name: kibini-${{ matrix.platform }}-amd64
38-
asset_path: /home/runner/go/bin/kibini-${{ matrix.platform }}-amd64
39-
asset_content_type: application/octet-stream
34+
release-tag: ${{ env.PROVAZIO_TAG }}
35+
files: kibini-${{ matrix.platform }}-amd64
36+
repo-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea/
22
.vscode
33
*.iml
4+
.bin

Makefile

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,20 @@ linux: $(LINUX_BIN_NAME) ## Build binary for linux
1818
darwin: $(DARWIN_BIN_NAME) ## Build binary for macOS
1919

2020
$(LINUX_BIN_NAME):
21-
env CGO_ENABLED=0 GOOS=linux $(GO_BUILD_COMMAND) -o $(GOPATH)/bin/$(LINUX_BIN_NAME) $(KIBINI_MAIN)
21+
env CGO_ENABLED=0 GOOS=linux $(GO_BUILD_COMMAND) -o $(LINUX_BIN_NAME) $(KIBINI_MAIN)
2222

2323
$(DARWIN_BIN_NAME):
24-
env CGO_ENABLED=0 GOOS=darwin $(GO_BUILD_COMMAND) -o $(GOPATH)/bin/$(DARWIN_BIN_NAME) $(KIBINI_MAIN)
24+
env CGO_ENABLED=0 GOOS=darwin $(GO_BUILD_COMMAND) -o $(DARWIN_BIN_NAME) $(KIBINI_MAIN)
2525

2626
bin: linux darwin ## Build binaries
2727
@echo Successfully Built binaries with version: $(VERSION)
2828

29+
fmt: ## Format code
30+
@go fmt $(shell go list ./... | grep -v /vendor/)
31+
2932
lint: ## Lint
30-
@echo Installing linters...
31-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin v1.24.0
32-
33-
@echo Linting...
34-
@$(GOPATH)/bin/golangci-lint run \
35-
--deadline=300s \
36-
--disable-all \
37-
--enable=deadcode \
38-
--enable=goconst \
39-
--enable=gofmt \
40-
--enable=golint \
41-
--enable=gosimple \
42-
--enable=ineffassign \
43-
--enable=interfacer \
44-
--enable=misspell \
45-
--enable=staticcheck \
46-
--enable=unconvert \
47-
--enable=varcheck \
48-
--enable=vet \
49-
--enable=vetshadow \
50-
--enable=errcheck \
51-
--exclude="_test.go" \
52-
--exclude="comment on" \
53-
--exclude="error should be the last" \
54-
--exclude="should have comment" \
55-
./pkg/... \
56-
./cmd/...
57-
@echo Done.
33+
./hack/lint/install.sh
34+
./hack/lint/run.sh
5835

5936
clean: ## Clean previously built binaries
6037
rm -rf $(GOPATH)/bin/kibini-*

cmd/kibini/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"os"
55
"path/filepath"
66

7-
"github.com/iguazio/kibini/pkg/kibini"
8-
"github.com/iguazio/kibini/pkg/loggerus"
7+
"github.com/v3io/kibini/pkg/kibini"
8+
"github.com/v3io/kibini/pkg/loggerus"
99

1010
"github.com/nuclio/errors"
1111
"github.com/sirupsen/logrus"

go.mod

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
1-
module github.com/iguazio/kibini
1+
module github.com/v3io/kibini
22

3-
go 1.14
3+
go 1.19
44

55
require (
6-
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
7-
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
86
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2
97
github.com/fatih/color v1.9.0
10-
github.com/fsnotify/fsnotify v1.4.9 // indirect
118
github.com/hpcloud/tail v1.0.0
12-
github.com/kr/pretty v0.1.0 // indirect
13-
github.com/mattn/go-colorable v0.1.6 // indirect
149
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
15-
github.com/nuclio/errors v0.0.2
10+
github.com/nuclio/errors v0.0.4
1611
github.com/nuclio/logger v0.0.1
17-
github.com/sirupsen/logrus v1.5.0
18-
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224
12+
github.com/sirupsen/logrus v1.9.0
13+
golang.org/x/tools v0.5.1-0.20230128195328-e2603688849b
1914
gopkg.in/alecthomas/kingpin.v2 v2.2.6
20-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
15+
)
16+
17+
require (
18+
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 // indirect
19+
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d // indirect
20+
github.com/fsnotify/fsnotify v1.4.9 // indirect
21+
github.com/mattn/go-colorable v0.1.6 // indirect
22+
github.com/mattn/go-isatty v0.0.12 // indirect
23+
golang.org/x/sys v0.4.0 // indirect
2124
gopkg.in/fsnotify.v1 v1.4.7 // indirect
2225
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
2326
)

go.sum

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d h1:UQZhZ2O0vMHr2c
44
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
55
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2 h1:axBiC50cNZOs7ygH5BgQp4N+aYrZ2DNpWZ1KG3VOSOM=
66
github.com/andrew-d/go-termutil v0.0.0-20150726205930-009166a695a2/go.mod h1:jnzFpU88PccN/tPPhCpnNU8mZphvKxYM9lLNkd8e+os=
7-
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
87
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
98
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
109
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -14,13 +13,6 @@ github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWo
1413
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
1514
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
1615
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
17-
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
18-
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
19-
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
20-
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
21-
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
22-
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
23-
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
2416
github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
2517
github.com/mattn/go-colorable v0.1.6 h1:6Su7aK7lXmJ/U79bYtBjLNaha4Fs1Rg9plHpcH+vvnE=
2618
github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
@@ -30,53 +22,35 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
3022
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
3123
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4=
3224
github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE=
33-
github.com/nuclio/errors v0.0.2 h1:c4vJFsDcCAsuyPMQ/Jacl6OVOHf7P4jMzgZnYjNIFq8=
34-
github.com/nuclio/errors v0.0.2/go.mod h1:it2rUqDarIL8PasLYZo0Q1Ebsx4NRPM+OyYYakgNyrQ=
25+
github.com/nuclio/errors v0.0.4 h1:Uf/Kfje0VJGYeuNAhuFNaL6bm0O1WCQOg8vEjiY85oQ=
26+
github.com/nuclio/errors v0.0.4/go.mod h1:KV56dHK50bOG4+fSUvCZA9D9Ky4utc5LBGGDCpxa8dY=
3527
github.com/nuclio/logger v0.0.1 h1:e+vT/Ug65RC+u0QX2J+lq3P57ZBwJ1ZA6Q2LCEcViwE=
3628
github.com/nuclio/logger v0.0.1/go.mod h1:ttazNAqTxKjQ7XrGDZxecumGa9KCIuJh88gzFY1mRXo=
3729
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
3830
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
39-
github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q=
40-
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
31+
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
32+
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
4133
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
42-
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
43-
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
4434
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
45-
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
46-
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
47-
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
48-
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
49-
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
50-
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
51-
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
52-
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
53-
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
54-
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
35+
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
36+
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
5537
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
56-
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
57-
golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc=
58-
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
5938
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6039
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
6140
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
62-
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
6341
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
64-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
65-
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
66-
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224 h1:azwY/v0y0K4mFHVsg5+UrTgchqALYWpqVo6vL5OmkmI=
67-
golang.org/x/tools v0.0.0-20200325010219-a49f79bcc224/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
68-
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
69-
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
70-
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
42+
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
43+
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
44+
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
45+
golang.org/x/tools v0.5.1-0.20230128195328-e2603688849b h1:nCvuY9jqM0HqWboVFYH7j4R++QxwXIr7V7YQJaB/g6U=
46+
golang.org/x/tools v0.5.1-0.20230128195328-e2603688849b/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k=
7147
gopkg.in/alecthomas/kingpin.v2 v2.2.6 h1:jMFz6MfLP0/4fUyZle81rXUoxOBFi19VUFKVDOQfozc=
7248
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
73-
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
7449
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
75-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
76-
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
7750
gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4=
7851
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
7952
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
8053
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
81-
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
8254
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
55+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
56+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

hack/lint/install.sh

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 Iguazio
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
set -e
18+
19+
echo Installing linters...
20+
21+
FORCE_INSTALL=false
22+
OS_NAME=$(uname -s)
23+
OS_NAME_LOWERCASE=$(echo "${OS_NAME}" | tr "[:upper:]" "[:lower:]")
24+
25+
if [[ -z "${BIN_DIR}" ]]; then
26+
BIN_DIR=$(pwd)/.bin
27+
fi
28+
29+
echo "Creating bin directory: ${BIN_DIR}"
30+
mkdir -p "${BIN_DIR}"
31+
32+
if [[ ! -f ${BIN_DIR}/impi ]] ; then
33+
echo "impi binary does not exist. Fetching and installing..."
34+
curl -sSfL --retry 3 https://api.github.com/repos/pavius/impi/releases/latest \
35+
| grep -i "browser_download_url.*impi.*${OS_NAME}" \
36+
| cut -d : -f 2,3 \
37+
| tr -d '"' \
38+
| tr -d '[:space:]' \
39+
| xargs curl -sSL --output "${BIN_DIR}"/impi
40+
chmod +x "${BIN_DIR}/impi"
41+
echo "impi installed in: ${BIN_DIR}/impi"
42+
fi
43+
44+
if [[ $# -ne 0 && "$1" == "force" ]]
45+
then
46+
echo "Force install golangci-lint requested"
47+
FORCE_INSTALL=true
48+
fi
49+
50+
if [[ $FORCE_INSTALL = true || ! -f ${BIN_DIR}/golangci-lint ]] ; then
51+
echo "golangci-lint binary does not exist or force install requested. Fetching and installing..."
52+
curl -sSfL --retry 3 https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${BIN_DIR}" v1.50.1
53+
echo "golangci-lint installed in: ${BIN_DIR}/golangci-lint"
54+
fi

hack/lint/run.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2019 Iguazio
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
set -e
18+
19+
OS_NAME=$(uname -s)
20+
OS_NAME_LOWERCASE=$(echo "${OS_NAME}" | tr "[:upper:]" "[:lower:]")
21+
22+
if [[ -z "${BIN_DIR}" ]]; then
23+
BIN_DIR=$(pwd)/.bin
24+
fi
25+
26+
echo Verifying imports...
27+
28+
"${BIN_DIR}"/impi \
29+
--local github.com/v3io/kibini/ \
30+
--scheme stdLocalThirdParty \
31+
./cmd/... ./pkg/...
32+
33+
echo "Linting @$(pwd)..."
34+
"${BIN_DIR}"/golangci-lint run -v --max-same-issues=100

pkg/loggerus/logger.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ package loggerus
33
import (
44
"context"
55
"fmt"
6+
"io"
7+
68
"github.com/nuclio/logger"
79
"github.com/sirupsen/logrus"
8-
"io"
910
)
1011

1112
type Loggerus struct {
1213
logrus *logrus.Logger
1314
name string
1415
}
1516

16-
// Creates a logger pre-configured for commands
17+
// NewJSONLoggerus Creates a logger pre-configured for commands
1718
func NewJSONLoggerus(name string, level logrus.Level, output io.Writer) (*Loggerus, error) {
1819

1920
// default timestamp formatting, and local timezone - defaults

0 commit comments

Comments
 (0)