sfreiberg / gotwilio

Twilio library for Go (golang).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SendSMS returns error "cannot unmarshal null"

superfrink opened this issue · comments

This code:

package main

import (
    "fmt"
    "github.com/sfreiberg/gotwilio"
)

func main() {

    accountSid := "123...123"
    authToken := "123...123"
    twilio := gotwilio.NewTwilioClient(accountSid, authToken)

    from := "+11235551234"
    to := "+11235551234"
    message := "Welcome to gotwilio!"

    response,exception,err := twilio.SendSMS(from, to, message, "", "")
    fmt.Printf("response: %+v\n",response)
    fmt.Printf("exception: %+v\n",exception)
    fmt.Printf("err: %+v\n",err)
}

successfully sends the SMS but it also prints this as part of the output:

exception: <nil>
err: json: cannot unmarshal null into Go value of type string

I would have expected err to be nil.

I'm unable to reproduce on latest release and go 1.4 so this might have been fixed in an earlier update. Closing for now. Please reopen if you are still able to reproduce.