Updated kill.go (#42)

in killTask function, null check removed for instances, as it is a mandatory parameter in the killTask command. Also made changes to improve language consistency
This commit is contained in:
ananaysingh 2022-09-15 23:07:02 +05:30 committed by GitHub
parent 7b298f7a35
commit 589e337e28
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ func init() {
killTasksCmd.MarkFlagRequired("environment")
killTasksCmd.MarkFlagRequired("role")
killTasksCmd.MarkFlagRequired("name")
killTasksCmd.MarkFlagRequired("instance")
killTasksCmd.MarkFlagRequired("instances")
}
var killCmd = &cobra.Command{
@ -107,11 +107,6 @@ func killTasks(cmd *cobra.Command, args []string) {
Role(*role).
Name(*name)
//Check that instance number is passed
if instances == nil {
log.Fatalln("Instance number not found. Please pass a valid instance number. If you want to pass multiple instances, please pass them as comma separated integer values")
}
/*
* In the following block, we convert instance numbers, which were passed as strings, to integer values
* After converting them to integers, we add them to a slice of type int32.