Skip to content

Commit

Permalink
lint fixes for go 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
bortok committed Apr 19, 2023
1 parent ebf3e93 commit 08bf394
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
all: get build tests

prereq:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2

lint:
golangci-lint run

get:
go get
go mod tidy
Expand Down
3 changes: 1 addition & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package cmd
import (
"fmt"
"io"
"io/ioutil"
"os"
"strconv"
"strings"
Expand Down Expand Up @@ -169,7 +168,7 @@ func initOTG() (gosnappi.GosnappiApi, gosnappi.Config) {
var otgbytes []byte
var err error
if otgFile != "" { // Read OTG config from file
otgbytes, err = ioutil.ReadFile(otgFile)
otgbytes, err = os.ReadFile(otgFile)
if err != nil {
log.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions cmd/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package cmd
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"text/template"

Expand Down Expand Up @@ -65,7 +64,7 @@ For more information, go to https://github.com/open-traffic-generator/otgen
var err error

if transformTemplateFile != "" { // Read template from file
templatebytes, err = ioutil.ReadFile(transformTemplateFile)
templatebytes, err = os.ReadFile(transformTemplateFile)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 08bf394

Please sign in to comment.