Skip to content

Add static check action to CI #6649

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

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
format
  • Loading branch information
Jim Ryan committed Oct 14, 2024
commit f7e378644055f1e0ee96f012ea4232cb0a6112a6
2 changes: 1 addition & 1 deletion cmd/nginx-ingress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"context"
"fmt"
"io"
"io/ioutil"

Check failure on line 7 in cmd/nginx-ingress/main.go

View workflow job for this annotation

GitHub Actions / Lint

SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)

Check failure on line 7 in cmd/nginx-ingress/main.go

View workflow job for this annotation

GitHub Actions / Unit Tests

"io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019)
"log/slog"
"net"
"net/http"
Expand Down Expand Up @@ -46,7 +47,6 @@
nl "github.com/nginxinc/kubernetes-ingress/internal/logger"
nic_glog "github.com/nginxinc/kubernetes-ingress/internal/logger/glog"
"github.com/nginxinc/kubernetes-ingress/internal/logger/levels"
"io/ioutil"
)

// Injected during build
Expand Down Expand Up @@ -74,10 +74,10 @@
)

func main() {
if false {

Check warning on line 77 in cmd/nginx-ingress/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/nginx-ingress/main.go#L77

Added line #L77 was not covered by tests
// this is to trigger static check deprecation error
data, err2 := ioutil.ReadFile("example.txt")
fmt.Println(data, err2)

Check warning on line 80 in cmd/nginx-ingress/main.go

View check run for this annotation

Codecov / codecov/patch

cmd/nginx-ingress/main.go#L79-L80

Added lines #L79 - L80 were not covered by tests
}

commitHash, commitTime, dirtyBuild := getBuildInfo()
Expand Down
Loading