Skip to content

Commit fc12d5c

Browse files
authored
Fix compiler error on line 20
This snippet gives a compiler warning that you cannot assign an error type to a string, err.Error() casts it correcty and allows it to compile. Original code gives this compiler error: cannot use err (variable of type error) as string value in argument to context.String
1 parent 41211f2 commit fc12d5c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rest/messages/generate-twiml-sms/generate-twiml-sms.1.x.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func main() {
1717

1818
twimlResult, err := twiml.Messages([]twiml.Element{message})
1919
if err != nil {
20-
context.String(http.StatusInternalServerError, err)
20+
context.String(http.StatusInternalServerError, err.Error())
2121
} else {
2222
context.Header("Content-Type", "text/xml")
2323
context.String(http.StatusOK, twimlResult)

0 commit comments

Comments
 (0)