Updated kill.go

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 17:26:29 +05:30
parent 7b298f7a35
commit 0c7534e48e

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.