Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v7 -> v8 #395

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,22 @@ This library requires Go 1.20 or later.
## Installation ##

```sh
$ go get -u github.com/line/line-bot-sdk-go/v7/linebot
$ go get -u github.com/line/line-bot-sdk-go/v8/linebot
```

## Import all packages in your code ##
```go
import (
"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v7/linebot/channel_access_token"
"github.com/line/line-bot-sdk-go/v7/linebot/insight"
"github.com/line/line-bot-sdk-go/v7/linebot/liff"
"github.com/line/line-bot-sdk-go/v7/linebot/manage_audience"
"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v7/linebot/module"
"github.com/line/line-bot-sdk-go/v7/linebot/module_attach"
"github.com/line/line-bot-sdk-go/v7/linebot/shop"
"github.com/line/line-bot-sdk-go/v7/linebot/webhook"
"github.com/line/line-bot-sdk-go/v8/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot/channel_access_token"
"github.com/line/line-bot-sdk-go/v8/linebot/insight"
"github.com/line/line-bot-sdk-go/v8/linebot/liff"
"github.com/line/line-bot-sdk-go/v8/linebot/manage_audience"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/module"
"github.com/line/line-bot-sdk-go/v8/linebot/module_attach"
"github.com/line/line-bot-sdk-go/v8/linebot/shop"
"github.com/line/line-bot-sdk-go/v8/linebot/webhook"
)

```
Expand All @@ -47,7 +47,7 @@ import (

```go
import (
"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func main() {
Expand Down Expand Up @@ -79,7 +79,7 @@ The LINE Messaging API primarily utilizes the JSON data format. To parse the inc

```go
import (
"github.com/line/line-bot-sdk-go/v7/linebot/webhook"
"github.com/line/line-bot-sdk-go/v8/linebot/webhook"
)

cb, err := webhook.ParseRequest(os.Getenv("LINE_CHANNEL_SECRET"), req)
Expand Down
2 changes: 1 addition & 1 deletion examples/delivery_helper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"log"
"os"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions examples/echo_bot/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"net/http"
"os"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v7/linebot/webhook"
"github.com/line/line-bot-sdk-go/v8/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/webhook"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions examples/echo_bot_handler/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"net/http"
"os"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v7/linebot/webhook"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/webhook"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/insight_helper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"log"
"os"

"github.com/line/line-bot-sdk-go/v7/linebot/insight"
"github.com/line/line-bot-sdk-go/v8/linebot/insight"
)

func main() {
Expand Down
Binary file added examples/kitchensink/kitchensink
Binary file not shown.
6 changes: 3 additions & 3 deletions examples/kitchensink/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import (
"path/filepath"
"runtime"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v7/linebot/webhook"
"github.com/line/line-bot-sdk-go/v8/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/webhook"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/richmenu_helper/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"os"
"strings"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"strconv"
"fmt"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type {{classname}} struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"strings"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/{{ packageName }}"
"github.com/line/line-bot-sdk-go/v8/linebot/{{ packageName }}"
)

{% for op in operations.operation %}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/line/line-bot-sdk-go/v7
module github.com/line/line-bot-sdk-go/v8

go 1.20
2 changes: 1 addition & 1 deletion linebot/channel_access_token/api_channel_access_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"net/url"
"path"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type ChannelAccessTokenAPI struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/channel_access_token"
"github.com/line/line-bot-sdk-go/v8/linebot/channel_access_token"
)

func TestGetsAllValidChannelAccessTokenKeyIds(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"os"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

func ExampleIDsScanner() {
Expand Down
2 changes: 1 addition & 1 deletion linebot/httphandler/httphandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"errors"
"net/http"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

// EventsHandlerFunc type
Expand Down
2 changes: 1 addition & 1 deletion linebot/httphandler/httphandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

var testRequestBody = `{
Expand Down
2 changes: 1 addition & 1 deletion linebot/insight/api_insight.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"net/url"
"path"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type InsightAPI struct {
Expand Down
2 changes: 1 addition & 1 deletion linebot/insight/tests/api/api_insight_test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/insight"
"github.com/line/line-bot-sdk-go/v8/linebot/insight"
)

func TestGetFriendsDemographics(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/liff/api_liff.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"path"
"strings"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type LiffAPI struct {
Expand Down
2 changes: 1 addition & 1 deletion linebot/liff/tests/api/api_liff_test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/liff"
"github.com/line/line-bot-sdk-go/v8/linebot/liff"
)

func TestAddLIFFApp(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/manage_audience/api_manage_audience.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"strconv"
"strings"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type ManageAudienceAPI struct {
Expand Down
2 changes: 1 addition & 1 deletion linebot/manage_audience/api_manage_audience_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"path"
"strconv"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type ManageAudienceBlobAPI struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/manage_audience"
"github.com/line/line-bot-sdk-go/v8/linebot/manage_audience"
)

func generateUUID() (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/messaging_api/api_messaging_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"path"
"strings"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type MessagingApiAPI struct {
Expand Down
2 changes: 1 addition & 1 deletion linebot/messaging_api/api_messaging_api_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"path"
"strings"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type MessagingApiBlobAPI struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func TestTextMessageWithHttpInfo(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func TestDatetimePickerAction(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
package tests


import (
"encoding/json"
"strings"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func TestTemplateMessage(t *testing.T) {
req := &messaging_api.ReplyMessageRequest{
ReplyToken: "JKLJDSFhkljdsjfkla",
Messages: []messaging_api.MessageInterface{
&messaging_api.TemplateMessage{
AltText: "Buttons alt text",
AltText: "Buttons alt text",
Template: &messaging_api.ButtonsTemplate{
ThumbnailImageUrl: "https://example.com/static/buttons/1040.jpg",
Title: "My button sample",
Expand Down Expand Up @@ -43,7 +42,7 @@ func TestFlexBubble(t *testing.T) {
ReplyToken: "KHJKLJSDFKLJSfudsifsjfakljfl",
Messages: []messaging_api.MessageInterface{
&messaging_api.FlexMessage{
AltText: "Flex message alt text",
AltText: "Flex message alt text",
Contents: messaging_api.FlexBubble{
Body: &messaging_api.FlexBox{
Layout: messaging_api.FlexBoxLAYOUT_HORIZONTAL,
Expand All @@ -69,4 +68,4 @@ func TestFlexBubble(t *testing.T) {
if !strings.Contains(encodedMsgStr, `"type":"box"`) {
t.Errorf("Encoded message doens't contains expected default value: %s", encodedMsgStr)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/messaging_api"
"github.com/line/line-bot-sdk-go/v8/linebot/messaging_api"
)

func TestStickerMessage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/module/api_line_module.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"path"
"strings"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type LineModuleAPI struct {
Expand Down
2 changes: 1 addition & 1 deletion linebot/module/tests/api/api_line_module_test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/module"
"github.com/line/line-bot-sdk-go/v8/linebot/module"
)

func TestAcquireChatControl(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/module_attach/api_line_module_attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"net/url"
"path"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type LineModuleAttachAPI struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/module_attach"
"github.com/line/line-bot-sdk-go/v8/linebot/module_attach"
)

func TestAttachModule(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/shop/api_shop.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"net/url"
"path"

"github.com/line/line-bot-sdk-go/v7/linebot"
"github.com/line/line-bot-sdk-go/v8/linebot"
)

type ShopAPI struct {
Expand Down
2 changes: 1 addition & 1 deletion linebot/shop/tests/api/api_shop_test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"net/http/httptest"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/shop"
"github.com/line/line-bot-sdk-go/v8/linebot/shop"
)

func TestMissionStickerV3(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion linebot/webhook/tests/handwritten/model_source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"

"github.com/line/line-bot-sdk-go/v7/linebot/webhook"
"github.com/line/line-bot-sdk-go/v8/linebot/webhook"
)

func TestStickerMessage(t *testing.T) {
Expand Down