Skip to content

Commit

Permalink
feat(go): updating go version and fixing lint (#31)
Browse files Browse the repository at this point in the history
Signed-off-by: rumstead <[email protected]>
  • Loading branch information
rumstead authored Apr 19, 2024
1 parent 4cf432b commit 2715a61
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
# Golang version to use across CI steps
GOLANG_VERSION: '1.18'
GOLANG_VERSION: '1.22'

jobs:
check-go:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- '*.*.*'
env:
# Golang version to use across CI steps
GOLANG_VERSION: '1.18'
GOLANG_VERSION: '1.22'

jobs:
goreleaser:
Expand All @@ -25,4 +25,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
- name: Update new version in krew-index
uses: rajatjindal/[email protected].43
uses: rajatjindal/[email protected].46
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/rumstead/kubectl-safe

go 1.18
go 1.22

require (
github.com/spf13/cobra v1.4.0
Expand Down
7 changes: 6 additions & 1 deletion pkg/cmd/safe/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,15 @@ func parseCommands(env string) (*Commands, error) {
func getCommandsFromFile(commands string) (*Commands, error) {
readCommands := NewCommands()
file, err := os.Open(commands)
defer file.Close()
if err != nil {
return nil, err
}
defer func(file *os.File) {
err = file.Close()
if err != nil {
klog.Errorf("error closing file %s: %v", file.Name(), err)
}
}(file)
klog.V(3).Infof("reading commands from %s.\n", commands)
scanner := bufio.NewScanner(file)
// scanner has a 64k limit on lines... i hope that is never reached
Expand Down

0 comments on commit 2715a61

Please sign in to comment.