From 76be7678a60b230f4493f53de4693df99527a847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8C=83=E5=A7=9C=E5=A3=AB=E5=A8=81?= Date: Fri, 13 Apr 2018 10:35:26 +0800 Subject: [PATCH] Template action label is optional for image carousel. --- linebot/template.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/linebot/template.go b/linebot/template.go index 4702de20..02310194 100644 --- a/linebot/template.go +++ b/linebot/template.go @@ -265,7 +265,7 @@ type URITemplateAction struct { func (a *URITemplateAction) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { Type TemplateActionType `json:"type"` - Label string `json:"label"` + Label string `json:"label,omitempty"` URI string `json:"uri"` }{ Type: TemplateActionTypeURI, @@ -284,7 +284,7 @@ type MessageTemplateAction struct { func (a *MessageTemplateAction) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { Type TemplateActionType `json:"type"` - Label string `json:"label"` + Label string `json:"label,omitempty"` Text string `json:"text"` }{ Type: TemplateActionTypeMessage, @@ -305,7 +305,7 @@ type PostbackTemplateAction struct { func (a *PostbackTemplateAction) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { Type TemplateActionType `json:"type"` - Label string `json:"label"` + Label string `json:"label,omitempty"` Data string `json:"data"` Text string `json:"text,omitempty"` DisplayText string `json:"displayText,omitempty"` @@ -332,7 +332,7 @@ type DatetimePickerTemplateAction struct { func (a *DatetimePickerTemplateAction) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { Type TemplateActionType `json:"type"` - Label string `json:"label"` + Label string `json:"label,omitempty"` Data string `json:"data"` Mode string `json:"mode"` Initial string `json:"initial,omitempty"`