Skip to content

Commit 570a3e6

Browse files
authored
[chore] Upgrade Go version to v1.19 (#1995)
Signed-off-by: tenzen-y <[email protected]> Signed-off-by: tenzen-y <[email protected]>
1 parent 6b55540 commit 570a3e6

File tree

15 files changed

+28
-32
lines changed

15 files changed

+28
-32
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fmt:
3232

3333
lint:
3434
ifndef HAS_LINT
35-
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0
35+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
3636
@echo "golangci-lint has been installed"
3737
endif
3838
hack/verify-golangci-lint.sh

cmd/katib-controller/v1beta1/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ limitations under the License.
1515
*/
1616

1717
/*
18-
Katib-controller is a controller (operator) for Experiments and Trials
18+
Katib-controller is a controller (operator) for Experiments and Trials
1919
*/
2020
package main
2121

cmd/metricscollector/v1beta1/file-metricscollector/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
"encoding/json"
4343
"flag"
4444
"fmt"
45-
"io/ioutil"
4645
"os"
4746
"path/filepath"
4847
"regexp"
@@ -268,7 +267,7 @@ func watchMetricsFile(mFile string, stopRules stopRulesFlag, filters []string, f
268267
klog.Fatalf("Create mark file %v error: %v", markFile, err)
269268
}
270269

271-
err = ioutil.WriteFile(markFile, []byte(common.TrainingEarlyStopped), 0)
270+
err = os.WriteFile(markFile, []byte(common.TrainingEarlyStopped), 0)
272271
if err != nil {
273272
klog.Fatalf("Write to file %v error: %v", markFile, err)
274273
}

docs/developer-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ see the following user guides:
1212

1313
## Requirements
1414

15-
- [Go](https://golang.org/) (1.18 or later)
15+
- [Go](https://golang.org/) (1.19 or later)
1616
- [Docker](https://docs.docker.com/) (20.10 or later)
1717
- [Docker Buildx](https://docs.docker.com/build/buildx/) (0.8.0 or later)
1818
- [Java](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) (8 or later)

examples/v1beta1/trial-images/simple-pbt/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In this problem, using PBT with a population of 2-4 is sufficient to
1919
roughly approximate this lr schedule. Higher population sizes will yield
2020
faster convergence. Training will not converge without PBT.
2121

22-
If you want read more about this example, vist the
22+
If you want to read more about this example, vist the
2323
[ray](https://github.com/ray-project/ray/blob/7f1bacc7dc9caf6d0ec042e39499bbf1d9a7d065/python/ray/tune/examples/README.rst)
2424
documentation.
2525

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kubeflow/katib
22

3-
go 1.18
3+
go 1.19
44

55
require (
66
github.com/DATA-DOG/go-sqlmock v1.5.0

hack/verify-golangci-lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ if [ -z "$(command -v golangci-lint)" ]; then
2525
fi
2626

2727
echo 'Running golangci-lint'
28-
golangci-lint run --timeout 5m --go 1.18
28+
golangci-lint run --timeout 5m --go 1.19

pkg/client/controller/clientset/versioned/fake/register.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/controller/clientset/versioned/scheme/register.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/metricscollector/v1beta1/common/pns.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package common
1818

1919
import (
2020
"fmt"
21-
"io/ioutil"
2221
"os"
2322
"path/filepath"
2423
"runtime"
@@ -139,7 +138,7 @@ func WaitPIDs(pids map[int]bool, mainPid int, opts WaitPidsOpts) error {
139138
if opts.CompletedMarkedDirPath != "" {
140139
markFile := filepath.Join(opts.CompletedMarkedDirPath, fmt.Sprintf("%d.pid", pid))
141140
// Read file with "completed" marker
142-
contents, err := ioutil.ReadFile(markFile)
141+
contents, err := os.ReadFile(markFile)
143142
if err != nil {
144143
return fmt.Errorf("training container is failed. Unable to read file %v for pid %v, error: %v", markFile, pid, err)
145144
}

0 commit comments

Comments
 (0)