Add staticcheck fixes (#3221)
* Add staticcheck fixes Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> * update golangci-lint version Signed-off-by: Sanket Sudake <sanketsudake@gmail.com> --------- Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
@@ -61,7 +61,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
|
||||
|
||||
fnName := input.String(flagkey.TtFnName)
|
||||
if len(fnName) == 0 {
|
||||
return errors.New("Need a function name to create a trigger, use --function")
|
||||
return errors.New("need a function name to create a trigger, use --function")
|
||||
}
|
||||
|
||||
userProvidedNS, fnNamespace, err := opts.GetResourceNamespace(input, flagkey.NamespaceFunction)
|
||||
@@ -71,7 +71,7 @@ func (opts *CreateSubCommand) complete(input cli.Input) (err error) {
|
||||
|
||||
cronSpec := input.String(flagkey.TtCron)
|
||||
if len(cronSpec) == 0 {
|
||||
return errors.New("Need a cron spec like '30 * * * *', '@every 1h30m', or '@hourly'; use --cron")
|
||||
return errors.New("need a cron spec like '30 * * * *', '@every 1h30m', or '@hourly'; use --cron")
|
||||
}
|
||||
|
||||
if input.Bool(flagkey.SpecSave) {
|
||||
|
||||
@@ -56,7 +56,7 @@ func (opts *ListSubCommand) do(input cli.Input) (err error) {
|
||||
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\n", "NAME", "CRON", "FUNCTION_NAME", "METHOD", "SUBPATH")
|
||||
for _, tt := range tts.Items {
|
||||
fmt.Fprintf(w, "%v\t%v\t%v\t%v\t%v\n",
|
||||
tt.ObjectMeta.Name, tt.Spec.Cron, tt.Spec.FunctionReference.Name, tt.Spec.Method, tt.Spec.Subpath)
|
||||
tt.ObjectMeta.Name, tt.Spec.Cron, tt.Spec.Name, tt.Spec.Method, tt.Spec.Subpath)
|
||||
}
|
||||
w.Flush()
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ func (opts *UpdateSubCommand) complete(input cli.Input) error {
|
||||
if err != nil {
|
||||
console.Warn(err.Error())
|
||||
}
|
||||
tt.Spec.FunctionReference.Name = fnName
|
||||
tt.Spec.Name = fnName
|
||||
updated = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user