How to use Ellipsis (…) in Golang?
The three dots (…) in Golang is termed as Ellipsis in Golang which is used in the variadic function. The function that called with the varying number of arguments is known as variadic function. Or in other words, a user is allowed to pass zero or more arguments in the variadic function. fmt.Printf is the example of the variadic function, it required one fixed argument at the starting after that it can accept any number of arguments.
The last parameter of the variadic function is always using the Ellipsis. It means it can accept any number of arguments.
Hello Rahul Hello Mohit Hello Rahul Hello Rohit Hello Johny
type of nums is int 89 found at index 0 in [89 90 95] type of nums is int 45 found at index 2 in [56 67 45 90 109] type of nums is int 78 not found in [38 56 98] type of nums is int 87 not found in 
My Personal Notes arrow_drop_up
Please Login to comment...