Question: In Golang, `http.NewRequest` has a specification like this:

```
func NewRequest(method, urlStr string, body io.Reader) (*Request, error)

```

However, I can pass `nil` as the `body` option if I don't want to pass the `body` to an `io.Reader` object, like this:

```
req, err := http.NewRequest("GET", "http://www.blahblah.org", nil)

```

How do I implement this functionality in my code? I have a function that I want to pass an optional string value so that it can page through API results however if I pass a `nil` to the string input I get this:

> 
> ./snippets.go:32: cannot convert nil to type string
> 
> 
> 

The parameters for my function look like this:

```
func getChallenges(after string) ([]challenge, string, error)

```

Answer: 
Go does not have "optional" arguments as a generally understood concept in other languages; `nil` is just the zero value for an interface (`io.Reader` in this case).

The equivalent zero value for a string is an empty string:

```
getChallenges("")

```

If you want to accept 0 or more of the same argument type, you use the variadic syntax:

```
func getChallenges(after ...string) ([]challenge, string, error)

```
you can use ellipse operator to send the optional parameters.. don't pass anything in optional parameter and check the length of parameter.
it should solve your problem

```
func foo(params ...int) {
   fmt.Println(len(params))
}

func main() {
    foo()
    foo(1)
    foo(1,2,3)
}

```