Skip to content

Commit

Permalink
remove unnecessary type conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
thevilledev authored and eikenb committed Dec 5, 2022
1 parent 1448dcd commit 378ee4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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 @@ -693,7 +693,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 @@ -974,8 +974,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 @@ -974,7 +974,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

0 comments on commit 378ee4b

Please sign in to comment.