Skip to content

Commit 1f4ec5f

Browse files
sarathsp06Sarath Pillai
andauthored
move to v6 respecting go modules release guidelines (#91)
* move to v6 respecting go modules release guidelines * Update UPGRADING.md * set ClientVersion to 6.0.0 * update badge Co-authored-by: Sarath Pillai <[email protected]>
1 parent 23b045e commit 1f4ec5f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+68
-59
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: go
2-
go_import_path: github.com/messagebird/go-rest-api
2+
go_import_path: github.com/messagebird/go-rest-api/v6
33
go:
4-
- "1.13"
54
- "1.14"
5+
- "1.15"
66
- stable
77
- master
88
matrix:

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ MessageBird's REST API for Go
22
=============================
33
This repository contains the open source Go client for MessageBird's REST API. Documentation can be found at: https://developers.messagebird.com.
44

5-
[![Build Status](https://travis-ci.org/messagebird/go-rest-api.svg?branch=master)](https://travis-ci.org/messagebird/go-rest-api) [![GoDoc](https://godoc.org/github.com/messagebird/go-rest-api?status.svg)](https://godoc.org/github.com/messagebird/go-rest-api)
5+
[![Build Status](https://travis-ci.org/messagebird/go-rest-api.svg?branch=master)](https://travis-ci.org/messagebird/go-rest-api) [![PkgGoDev](https://pkg.go.dev/badge/github.com/messagebird/go-rest-api)](https://pkg.go.dev/github.com/messagebird/go-rest-api)
66

77
Requirements
88
------------
@@ -15,15 +15,15 @@ Installation
1515
The easiest way to use the MessageBird API in your Go project is to install it using *go get*:
1616

1717
```
18-
$ go get github.com/messagebird/go-rest-api
18+
$ go get github.com/messagebird/go-rest-api/v6
1919
```
2020

2121
Examples
2222
--------
2323
Here is a quick example on how to get started. Assuming the **go get** installation worked, you can import the messagebird package like this:
2424

2525
```go
26-
import "github.com/messagebird/go-rest-api"
26+
import "github.com/messagebird/go-rest-api/v6"
2727
```
2828

2929
Then, create an instance of **messagebird.Client**. It can be used to access the MessageBird APIs.
@@ -69,8 +69,8 @@ For this reason, errors returned by the `voice` package are of type `voice.Error
6969
An example of "simple" error handling is shown in the example above. Let's look how we can gain more in-depth insight in what exactly went wrong:
7070

7171
```go
72-
import "github.com/messagebird/go-rest-api"
73-
import "github.com/messagebird/go-rest-api/sms"
72+
import "github.com/messagebird/go-rest-api/v6"
73+
import "github.com/messagebird/go-rest-api/v6/sms"
7474

7575
// ...
7676

@@ -91,7 +91,7 @@ if err != nil {
9191
`voice.ErrorResponse` is very similar, except that it holds `voice.Error` structs - those contain only `Code` and `Message` (not description!) fields:
9292

9393
```go
94-
import "github.com/messagebird/go-rest-api/voice"
94+
import "github.com/messagebird/go-rest-api/v6/voice"
9595

9696
// ...
9797

UPGRADING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,12 @@ if err != nil {
9292

9393
### Other improvements
9494
Although those are all breaking changes, it's worth mentioning this new version brings a number of other improvements. An example is that the client now supports contacts and groups - enjoy!
95+
96+
97+
## `v5.5.0` -> `v6.0.0`
98+
### Version suffix
99+
To preserve import compatibility, the go command requires that modules with major version v2 or later use a module path with that major version as the final element.
100+
101+
So all imports of `go-rest-api` are replaced as `go-rest-api/v6`.
102+
103+

balance/balance.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package balance
33
import (
44
"net/http"
55

6-
messagebird "github.com/messagebird/go-rest-api"
6+
messagebird "github.com/messagebird/go-rest-api/v6"
77
)
88

99
// Balance describes your balance information.

balance/balance_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"net/http"
55
"testing"
66

7-
messagebird "github.com/messagebird/go-rest-api"
8-
"github.com/messagebird/go-rest-api/internal/mbtest"
7+
messagebird "github.com/messagebird/go-rest-api/v6"
8+
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
99
)
1010

1111
const Epsilon float32 = 0.001

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626

2727
const (
2828
// ClientVersion is used in User-Agent request header to provide server with API level.
29-
ClientVersion = "5.5.0"
29+
ClientVersion = "6.0.0"
3030

3131
// Endpoint points you to MessageBird REST API.
3232
Endpoint = "https://rest.messagebird.com"

contact/contact.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"strconv"
99
"time"
1010

11-
messagebird "github.com/messagebird/go-rest-api"
11+
messagebird "github.com/messagebird/go-rest-api/v6"
1212
)
1313

1414
// Contact gets returned by the API.

contact/contact_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/messagebird/go-rest-api/internal/mbtest"
8+
"github.com/messagebird/go-rest-api/v6/internal/mbtest"
99
)
1010

1111
func TestMain(m *testing.M) {

conversation/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strconv"
88
"time"
99

10-
messagebird "github.com/messagebird/go-rest-api"
10+
messagebird "github.com/messagebird/go-rest-api/v6"
1111
)
1212

1313
const (

conversation/conversation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"net/http"
66

7-
messagebird "github.com/messagebird/go-rest-api"
7+
messagebird "github.com/messagebird/go-rest-api/v6"
88
)
99

1010
// ListOptions can be used to set pagination options in List().

0 commit comments

Comments
 (0)