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: 
You can modify you function to receive pointer value, like this:

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

Then you can pass `nil` as an argument to it. But don't forget to check `after` for `nil` value inside your function before dereferencing it, or you will get a nil pointer exception:

```
func getChallenges(after *string) ([]challenge, string, error) {
    if after == nil {
        // No value specified
    } else {
        fmt.Printf("After: %s\n", *after) // Note pointer dereferencing with "*"
    }
    // ...
}

```

**Another option:**

Just use two functions:

```
func getChallenges(after string) {}

func getAllChallenges() {
    return getChallenges(/* some default value here */)
}

```
Maybe wrap it in a `struct`?

```golang
type NilableString struct {
    value string;
}

```