Skip to content

Commit

Permalink
[chore] Upgrade Go version to v1.19 (#1995)
Browse files Browse the repository at this point in the history
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>

Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y authored Nov 3, 2022
1 parent 6b55540 commit 570a3e6
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 32 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fmt:

lint:
ifndef HAS_LINT
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
@echo "golangci-lint has been installed"
endif
hack/verify-golangci-lint.sh
Expand Down
2 changes: 1 addition & 1 deletion cmd/katib-controller/v1beta1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

/*
Katib-controller is a controller (operator) for Experiments and Trials
Katib-controller is a controller (operator) for Experiments and Trials
*/
package main

Expand Down
3 changes: 1 addition & 2 deletions cmd/metricscollector/v1beta1/file-metricscollector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
Expand Down Expand Up @@ -268,7 +267,7 @@ func watchMetricsFile(mFile string, stopRules stopRulesFlag, filters []string, f
klog.Fatalf("Create mark file %v error: %v", markFile, err)
}

err = ioutil.WriteFile(markFile, []byte(common.TrainingEarlyStopped), 0)
err = os.WriteFile(markFile, []byte(common.TrainingEarlyStopped), 0)
if err != nil {
klog.Fatalf("Write to file %v error: %v", markFile, err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ see the following user guides:

## Requirements

- [Go](https://golang.org/) (1.18 or later)
- [Go](https://golang.org/) (1.19 or later)
- [Docker](https://docs.docker.com/) (20.10 or later)
- [Docker Buildx](https://docs.docker.com/build/buildx/) (0.8.0 or later)
- [Java](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) (8 or later)
Expand Down
2 changes: 1 addition & 1 deletion examples/v1beta1/trial-images/simple-pbt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ In this problem, using PBT with a population of 2-4 is sufficient to
roughly approximate this lr schedule. Higher population sizes will yield
faster convergence. Training will not converge without PBT.

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

Expand Down
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/kubeflow/katib

go 1.18
go 1.19

require (
github.com/DATA-DOG/go-sqlmock v1.5.0
Expand Down
2 changes: 1 addition & 1 deletion hack/verify-golangci-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ if [ -z "$(command -v golangci-lint)" ]; then
fi

echo 'Running golangci-lint'
golangci-lint run --timeout 5m --go 1.18
golangci-lint run --timeout 5m --go 1.19
14 changes: 7 additions & 7 deletions pkg/client/controller/clientset/versioned/fake/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pkg/client/controller/clientset/versioned/scheme/register.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pkg/metricscollector/v1beta1/common/pns.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package common

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"runtime"
Expand Down Expand Up @@ -139,7 +138,7 @@ func WaitPIDs(pids map[int]bool, mainPid int, opts WaitPidsOpts) error {
if opts.CompletedMarkedDirPath != "" {
markFile := filepath.Join(opts.CompletedMarkedDirPath, fmt.Sprintf("%d.pid", pid))
// Read file with "completed" marker
contents, err := ioutil.ReadFile(markFile)
contents, err := os.ReadFile(markFile)
if err != nil {
return fmt.Errorf("training container is failed. Unable to read file %v for pid %v, error: %v", markFile, pid, err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package sidecarmetricscollector
import (
"encoding/json"
"fmt"
"io/ioutil"
"io"
"os"
"regexp"
"strconv"
Expand All @@ -40,7 +40,7 @@ func CollectObservationLog(fileName string, metrics []string, filters []string,
return nil, err
}
defer file.Close()
content, err := ioutil.ReadAll(file)
content, err := io.ReadAll(file)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/new-ui/v1beta1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (k *KatibUIHandler) FetchTrialTemplates(w http.ResponseWriter, r *http.Requ
}
}

//AddTemplate adds template to ConfigMap
// AddTemplate adds template to ConfigMap
func (k *KatibUIHandler) AddTemplate(w http.ResponseWriter, r *http.Request) {
var data map[string]interface{}
if err := json.NewDecoder(r.Body).Decode(&data); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/ui/v1beta1/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (k *KatibUIHandler) FetchTrialTemplates(w http.ResponseWriter, r *http.Requ
}
}

//AddTemplate adds template to ConfigMap
// AddTemplate adds template to ConfigMap
func (k *KatibUIHandler) AddTemplate(w http.ResponseWriter, r *http.Request) {
var data map[string]interface{}
if err := json.NewDecoder(r.Body).Decode(&data); err != nil {
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/v1beta1/hack/aws/run-e2e-experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -55,7 +54,7 @@ func main() {
log.Fatal("Path to Experiment yaml is missing")
}
expPath := os.Args[1]
byteExp, err := ioutil.ReadFile(expPath)
byteExp, err := os.ReadFile(expPath)
if err != nil {
log.Fatalf("Error in reading file: %v", err)
}
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/v1beta1/hack/gh-actions/run-e2e-experiment.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
Expand All @@ -47,7 +46,7 @@ func main() {
log.Fatal("Path to Experiment yaml is missing")
}
expPath := os.Args[1]
byteExp, err := ioutil.ReadFile(expPath)
byteExp, err := os.ReadFile(expPath)
if err != nil {
log.Fatalf("Error in reading file: %v", err)
}
Expand Down

0 comments on commit 570a3e6

Please sign in to comment.