Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golang version #114

Merged
merged 10 commits into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/ci-build.yaml
Expand Up @@ -12,7 +12,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: golang:1.17-alpine3.16
image: golang:1.18.6-alpine3.16

steps:
- name: Harden Runner
Expand All @@ -30,14 +30,13 @@ jobs:

- name: Format
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/goimports@latest
Fixed Show fixed Hide fixed
res="$(goimports -l .)"
if [[ "$(printf '%s' "$res")" != '' ]]; then
echo "Unformatted source code:"
echo "$res"
exit 1
fi

- name: Vet
run: |
go vet ./...
Expand All @@ -46,9 +45,9 @@ jobs:
run: |
go test ./...

- uses: dominikh/staticcheck-action@4ec9a0dff54be2642bc76581598ba433fd8d4967
- uses: dominikh/staticcheck-action@v1.2.0
Fixed Show fixed Hide fixed
Fixed Show fixed Hide fixed
jniesz marked this conversation as resolved.
Show resolved Hide resolved
with:
version: "2021.1.2"
version: "2022.1.1"
install-go: false

- name: Build
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -4,8 +4,8 @@ export GOPATH := $(HOME)/go
all: swagger build

swagger:
@mkdir $(GOPATH) || true
@go get -u github.com/swaggo/swag/cmd/swag
@mkdir $(GOPATH) || true
@go install github.com/swaggo/swag/cmd/swag@latest
@go get -u github.com/swaggo/http-swagger
@go get -u github.com/alecthomas/template
@$(GOPATH)/bin/swag init -d "./" -g "apis/configwatch.go"
Expand Down
3 changes: 1 addition & 2 deletions apis/configwatch.go
Expand Up @@ -11,7 +11,6 @@ import (
"crypto/tls"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"net"
"net/http"
"os"
Expand Down Expand Up @@ -79,7 +78,7 @@ func StartConfigWatcher(ctx context.Context, hostname, daemonName string, conf *
if conf.MTLSEnabled {
log.Info().Msgf("l3afd server listening with mTLS - %s ", conf.L3afConfigsRestAPIAddr)
// Create a CA certificate pool and add client ca's to it
caCert, err := ioutil.ReadFile(path.Join(conf.MTLSCertDir, conf.MTLSCACertFilename))
caCert, err := os.ReadFile(path.Join(conf.MTLSCertDir, conf.MTLSCACertFilename))
if err != nil {
log.Fatal().Err(err).Msgf("client CA %s file not found", conf.MTLSCACertFilename)
}
Expand Down
4 changes: 2 additions & 2 deletions apis/handlers/addprog.go
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"encoding/json"
"fmt"
"io"

"io/ioutil"
"net/http"

"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -45,7 +45,7 @@ func AddEbpfPrograms(ctx context.Context, kfcfg *kf.NFConfigs) http.HandlerFunc
log.Warn().Msgf("Empty request body")
return
}
bodyBuffer, err := ioutil.ReadAll(r.Body)
bodyBuffer, err := io.ReadAll(r.Body)
if err != nil {
mesg = fmt.Sprintf("failed to read request body: %v", err)
log.Error().Msg(mesg)
Expand Down
4 changes: 2 additions & 2 deletions apis/handlers/deleteprog.go
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"encoding/json"
"fmt"
"io"

"io/ioutil"
"net/http"

"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -45,7 +45,7 @@ func DeleteEbpfPrograms(ctx context.Context, kfcfg *kf.NFConfigs) http.HandlerFu
log.Warn().Msgf("Empty request body")
return
}
bodyBuffer, err := ioutil.ReadAll(r.Body)
bodyBuffer, err := io.ReadAll(r.Body)
if err != nil {
mesg = fmt.Sprintf("failed to read request body: %v", err)
log.Error().Msg(mesg)
Expand Down
4 changes: 2 additions & 2 deletions apis/handlers/updateconfig.go
Expand Up @@ -7,8 +7,8 @@ import (
"context"
"encoding/json"
"fmt"
"io"

"io/ioutil"
"net/http"

"github.com/rs/zerolog/log"
Expand Down Expand Up @@ -45,7 +45,7 @@ func UpdateConfig(ctx context.Context, kfcfg *kf.NFConfigs) http.HandlerFunc {
log.Warn().Msgf("Empty request body")
return
}
bodyBuffer, err := ioutil.ReadAll(r.Body)
bodyBuffer, err := io.ReadAll(r.Body)
if err != nil {
mesg = fmt.Sprintf("failed to read request body: %v", err)
log.Error().Msg(mesg)
Expand Down
20 changes: 10 additions & 10 deletions go.mod
@@ -1,6 +1,6 @@
module github.com/l3af-project/l3afd

go 1.17
go 1.18

require (
github.com/cilium/ebpf v0.9.0
Expand All @@ -10,9 +10,9 @@ require (
github.com/robfig/config v0.0.0-20141207224736-0f78529c8c7e
github.com/rs/zerolog v1.27.0
github.com/safchain/ethtool v0.0.0-20210803160452-9aa261dae9b1
github.com/swaggo/http-swagger v1.3.0
github.com/swaggo/swag v1.8.2
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // exclude
github.com/swaggo/http-swagger v1.3.3
github.com/swaggo/swag v1.8.1
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 // exclude
)

require github.com/golang/mock v1.6.0
Expand All @@ -23,8 +23,8 @@ require (
github.com/cespare/xxhash/v2 v2.1.1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/spec v0.20.6 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-openapi/spec v0.20.7 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
Expand All @@ -34,9 +34,9 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.26.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe // indirect
golang.org/x/net v0.0.0-20220526153639-5463443f8c37 // indirect
golang.org/x/tools v0.1.10 // indirect
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect
golang.org/x/net v0.0.0-20220921155015-db77216a4ee9 // indirect
golang.org/x/tools v0.1.12 // indirect
google.golang.org/protobuf v1.26.0-rc.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)