DEV Community

Divyanshu Shekhar
Divyanshu Shekhar

Posted on

Golang Variadic Arguments With Example

#go

Golang Variadic Arguments

Sometimes we don’t know how much parameters will be passed and then comes Variadic Parameters in Golang.

Condition for Variadic Argument:

  1. Variadic Arguments should only be one and must be placed at last.
  2. It is taken as Golang Slice, and Slice operations can be done on it.

Variadic Arguments Syntax

<parameter_name> …<type>

Learn more about Golang Variadic Arguments from the Original Post.

Top comments (0)