Skip to content
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

Remove unnecessary type conversions from various places #1681

Merged
merged 1 commit into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion config/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ func TestTimeDurationVal(t *testing.T) {
{
"present",
TimeDuration(10 * time.Second),
time.Duration(10 * time.Second),
10 * time.Second,
},
}

Expand Down
6 changes: 3 additions & 3 deletions manager/runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ func TestRunner_Start(t *testing.T) {
c := config.DefaultConfig().Merge(&config.Config{
Exec: &config.ExecConfig{
Command: []string{`sleep 30`},
KillTimeout: config.TimeDuration(time.Duration(10 * time.Second)),
KillTimeout: config.TimeDuration(10 * time.Second),
},
Templates: &config.TemplateConfigs{
&config.TemplateConfig{
Expand Down Expand Up @@ -975,8 +975,8 @@ func TestRunner_Start(t *testing.T) {
}
}
exp := "foo"
if exp != string(act) {
t.Errorf("\nexp: %#v\nact: %#v", exp, string(act))
if exp != act {
t.Errorf("\nexp: %#v\nact: %#v", exp, act)
}
expOut := "> \nfoo"
if expOut != o.String() {
Expand Down
2 changes: 1 addition & 1 deletion template/funcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ func loop(ifaces ...interface{}) (<-chan int64, error) {
switch v.Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32,
reflect.Int64:
return int64(v.Int()), nil
return v.Int(), nil
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32,
reflect.Uint64:
return int64(v.Uint()), nil
Expand Down