attachments := slack.NewAttachments(1)
attachments[0].SetFallback("Required plain-text summary of the attachment.").SetTitle("タイトル")
json, err := slack.JSON(attachments)
if err != nil {
log.Println(err)
}
c := slack.NewClient()
c.SetToken("YOUR TOKEN").SetChannel("#general").SetText("こんにちは").SetAttachments(json).PostMessage()
You can check the token for test from here.
go get github.com/kwmt/slack