Repository: opensearch-project/opensearch-go
Pull request #119 (2022-06-14 16:42:40)

[Backport 2.0] Update module path to use /v2
Backport e0724603ff96612a144cb6bbae6a48e28d2a2f5e from #118


Patch:
diff --git a/USER_GUIDE.md b/USER_GUIDE.md
index 5ed4ac3..b6ee25a 100644
--- a/USER_GUIDE.md
+++ b/USER_GUIDE.md
@@ -15,8 +15,8 @@ import (
     "context"
     "crypto/tls"
     "fmt"
-    opensearch "github.com/opensearch-project/opensearch-go"
-    opensearchapi "github.com/opensearch-project/opensearch-go/opensearchapi"
+    opensearch "github.com/opensearch-project/opensearch-go/v2"
+    opensearchapi "github.com/opensearch-project/opensearch-go/v2/opensearchapi"
     "net/http"
     "strings"
 )
@@ -148,9 +148,9 @@ import (
 	"log"
 
 	"github.com/aws/aws-sdk-go/aws/session"
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	requestsigner "github.com/opensearch-project/opensearch-go/signer/aws"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	requestsigner "github.com/opensearch-project/opensearch-go/v2/signer/aws"
 )
 
 const endpoint = "" // e.g. https://opensearch-domain.region.com
diff --git a/go.mod b/go.mod
index 5cbfa33..941b00d 100644
--- a/go.mod
+++ b/go.mod
@@ -1,4 +1,4 @@
-module github.com/opensearch-project/opensearch-go
+module github.com/opensearch-project/opensearch-go/v2
 
 go 1.11
 
diff --git a/internal/build/cmd/commands.go b/internal/build/cmd/commands.go
index 859ec3b..a1ef441 100644
--- a/internal/build/cmd/commands.go
+++ b/internal/build/cmd/commands.go
@@ -31,7 +31,7 @@ import (
 
 	"github.com/spf13/cobra"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var rootCmd = &cobra.Command{
diff --git a/internal/build/cmd/generate/commands/genexamples/command.go b/internal/build/cmd/generate/commands/genexamples/command.go
index 7d76c73..81a9ddb 100644
--- a/internal/build/cmd/generate/commands/genexamples/command.go
+++ b/internal/build/cmd/generate/commands/genexamples/command.go
@@ -39,12 +39,12 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
 	"github.com/spf13/cobra"
 	"golang.org/x/tools/imports"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/genexamples/translator.go b/internal/build/cmd/generate/commands/genexamples/translator.go
index d87cefb..6d23267 100644
--- a/internal/build/cmd/generate/commands/genexamples/translator.go
+++ b/internal/build/cmd/generate/commands/genexamples/translator.go
@@ -39,7 +39,7 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 const testCheck = "\t" + `if err != nil {            // SKIP
diff --git a/internal/build/cmd/generate/commands/gensource/command.go b/internal/build/cmd/generate/commands/gensource/command.go
index b18bfa4..670150b 100644
--- a/internal/build/cmd/generate/commands/gensource/command.go
+++ b/internal/build/cmd/generate/commands/gensource/command.go
@@ -35,11 +35,11 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
 	"github.com/spf13/cobra"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/gensource/debug.go b/internal/build/cmd/generate/commands/gensource/debug.go
index 3eaef5c..c1606f1 100644
--- a/internal/build/cmd/generate/commands/gensource/debug.go
+++ b/internal/build/cmd/generate/commands/gensource/debug.go
@@ -32,7 +32,7 @@ import (
 	"strings"
 	"text/tabwriter"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 // DebugInfo returns information about the endpoint as a string.
diff --git a/internal/build/cmd/generate/commands/gensource/generator.go b/internal/build/cmd/generate/commands/gensource/generator.go
index 7a96a8e..69472c1 100644
--- a/internal/build/cmd/generate/commands/gensource/generator.go
+++ b/internal/build/cmd/generate/commands/gensource/generator.go
@@ -35,7 +35,7 @@ import (
 
 	"golang.org/x/tools/imports"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 // Generator represents the "gensource" generator.
diff --git a/internal/build/cmd/generate/commands/gensource/model.go b/internal/build/cmd/generate/commands/gensource/model.go
index 05e2a4e..af72cd7 100644
--- a/internal/build/cmd/generate/commands/gensource/model.go
+++ b/internal/build/cmd/generate/commands/gensource/model.go
@@ -36,7 +36,7 @@ import (
 
 	"gopkg.in/yaml.v2"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/genstruct/command.go b/internal/build/cmd/generate/commands/genstruct/command.go
index a56829b..0109dbd 100644
--- a/internal/build/cmd/generate/commands/genstruct/command.go
+++ b/internal/build/cmd/generate/commands/genstruct/command.go
@@ -35,14 +35,14 @@ import (
 	"path/filepath"
 	"strings"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
 	"golang.org/x/tools/go/packages"
 	"golang.org/x/tools/imports"
 
 	"github.com/spf13/cobra"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/tools/commands/spec/command.go b/internal/build/cmd/tools/commands/spec/command.go
index 962711c..6e59ff0 100644
--- a/internal/build/cmd/tools/commands/spec/command.go
+++ b/internal/build/cmd/tools/commands/spec/command.go
@@ -40,9 +40,9 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
-	"github.com/opensearch-project/opensearch-go/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
 	"github.com/spf13/cobra"
 )
 
diff --git a/internal/build/go.mod b/internal/build/go.mod
index c7a097b..fa01aa2 100644
--- a/internal/build/go.mod
+++ b/internal/build/go.mod
@@ -1,16 +1,14 @@
-module github.com/opensearch-project/opensearch-go/internal/build
+module github.com/opensearch-project/opensearch-go/v2/internal/build
 
 go 1.15
 
-replace github.com/opensearch-project/opensearch-go => ../../
+replace github.com/opensearch-project/opensearch-go/v2 => ../../
 
 require (
 	github.com/alecthomas/chroma v0.8.2
+	github.com/opensearch-project/opensearch-go/v2 v2.0.0
 	github.com/spf13/cobra v1.1.3
-	github.com/opensearch-project/opensearch-go v1.0.0
-	github.com/stretchr/testify v1.4.0 // indirect
 	golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
-	golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57 // indirect
 	golang.org/x/tools v0.1.0
 	gopkg.in/yaml.v2 v2.4.0
 )
diff --git a/internal/build/go.sum b/internal/build/go.sum
index 745fec8..7b0662e 100644
--- a/internal/build/go.sum
+++ b/internal/build/go.sum
@@ -138,6 +138,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
 github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
+github.com/opensearch-project/opensearch-go v1.0.0 h1:8Gh7B7Un5BxuxWAgmzleEF7lpOtC71pCgPp7lKr3ca8=
+github.com/opensearch-project/opensearch-go v1.0.0/go.mod h1:FrUl/52DBegRYvK7ISF278AXmjDV647lyTnsLGBR7J4=
+github.com/opensearch-project/opensearch-go/internal/build v0.0.0-20220526230748-c0a8490561ee h1:SgAYCqLeyhYZGsbcPe/UPPIhDjCs1skVcJ5YNXDuPqM=
+github.com/opensearch-project/opensearch-go/internal/build v0.0.0-20220526230748-c0a8490561ee/go.mod h1:6g8N/LzgN6WEIptSLcjzoq9fb3L8E6VOrSuO0PzwTrM=
 github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
 github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -181,8 +185,9 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
 github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
-github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
 github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
 github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
@@ -334,6 +339,8 @@ gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
 gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
 honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
diff --git a/internal/build/main.go b/internal/build/main.go
index cae68de..a4f7131 100644
--- a/internal/build/main.go
+++ b/internal/build/main.go
@@ -27,13 +27,13 @@
 package main
 
 import (
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
 
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/genexamples"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/gensource"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/genstruct"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/gentests"
-	_ "github.com/opensearch-project/opensearch-go/internal/build/cmd/tools/commands/spec"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/genexamples"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/gensource"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/genstruct"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/gentests"
+	_ "github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/tools/commands/spec"
 )
 
 func main() {
diff --git a/opensearch.go b/opensearch.go
index cb6e733..593916f 100644
--- a/opensearch.go
+++ b/opensearch.go
@@ -42,11 +42,11 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/signer"
+	"github.com/opensearch-project/opensearch-go/v2/signer"
 
-	"github.com/opensearch-project/opensearch-go/internal/version"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var (
diff --git a/opensearchapi/opensearchapi.go b/opensearchapi/opensearchapi.go
index 35804c3..92b728a 100644
--- a/opensearchapi/opensearchapi.go
+++ b/opensearchapi/opensearchapi.go
@@ -31,7 +31,7 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
 )
 
 // Version returns the package version as a string.
diff --git a/opensearchtransport/opensearchtransport.go b/opensearchtransport/opensearchtransport.go
index 725fddc..491a9b7 100644
--- a/opensearchtransport/opensearchtransport.go
+++ b/opensearchtransport/opensearchtransport.go
@@ -45,9 +45,9 @@ import (
 	"sync"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go/signer"
+	"github.com/opensearch-project/opensearch-go/v2/signer"
 
-	"github.com/opensearch-project/opensearch-go/internal/version"
+	"github.com/opensearch-project/opensearch-go/v2/internal/version"
 )
 
 const (
diff --git a/opensearchutil/bulk_indexer.go b/opensearchutil/bulk_indexer.go
index 2d23d1a..3f08cec 100644
--- a/opensearchutil/bulk_indexer.go
+++ b/opensearchutil/bulk_indexer.go
@@ -38,8 +38,8 @@ import (
 	"sync/atomic"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 // BulkIndexer represents a parallel, asynchronous, efficient indexer for OpenSearch.


Test patch:
diff --git a/internal/build/cmd/generate/commands/gensource/generator_test.go b/internal/build/cmd/generate/commands/gensource/generator_test.go
index da7e84d..62181e1 100644
--- a/internal/build/cmd/generate/commands/gensource/generator_test.go
+++ b/internal/build/cmd/generate/commands/gensource/generator_test.go
@@ -32,7 +32,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd/generate/commands/gensource"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd/generate/commands/gensource"
 )
 
 func TestGenerator(t *testing.T) {
diff --git a/internal/build/cmd/generate/commands/gentests/command.go b/internal/build/cmd/generate/commands/gentests/command.go
index ff853f0..e90b730 100644
--- a/internal/build/cmd/generate/commands/gentests/command.go
+++ b/internal/build/cmd/generate/commands/gentests/command.go
@@ -41,8 +41,8 @@ import (
 	"github.com/spf13/cobra"
 	yaml "gopkg.in/yaml.v2"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/cmd"
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/cmd"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/gentests/debug.go b/internal/build/cmd/generate/commands/gentests/debug.go
index aef7693..d30ca35 100644
--- a/internal/build/cmd/generate/commands/gentests/debug.go
+++ b/internal/build/cmd/generate/commands/gentests/debug.go
@@ -30,7 +30,7 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 // DebugInfo returns information about the endpoint as a string.
diff --git a/internal/build/cmd/generate/commands/gentests/generator.go b/internal/build/cmd/generate/commands/gentests/generator.go
index 464d92b..06cc716 100644
--- a/internal/build/cmd/generate/commands/gentests/generator.go
+++ b/internal/build/cmd/generate/commands/gentests/generator.go
@@ -221,9 +221,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var (
diff --git a/internal/build/cmd/generate/commands/gentests/model.go b/internal/build/cmd/generate/commands/gentests/model.go
index 4cfeccf..6e48090 100644
--- a/internal/build/cmd/generate/commands/gentests/model.go
+++ b/internal/build/cmd/generate/commands/gentests/model.go
@@ -35,7 +35,7 @@ import (
 	"strconv"
 	"strings"
 
-	"github.com/opensearch-project/opensearch-go/internal/build/utils"
+	"github.com/opensearch-project/opensearch-go/v2/internal/build/utils"
 )
 
 var reFilename = regexp.MustCompile(`\d*_?(.+)\.ya?ml`)
diff --git a/opensearch_benchmark_test.go b/opensearch_benchmark_test.go
index cc7eb75..020ac38 100644
--- a/opensearch_benchmark_test.go
+++ b/opensearch_benchmark_test.go
@@ -36,8 +36,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 var defaultResponse = http.Response{
diff --git a/opensearch_example_test.go b/opensearch_example_test.go
index 88747ec..6c45b15 100644
--- a/opensearch_example_test.go
+++ b/opensearch_example_test.go
@@ -36,8 +36,8 @@ import (
 	"os"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 func init() {
diff --git a/opensearch_integration_test.go b/opensearch_integration_test.go
index 9e16dc9..3a438fb 100644
--- a/opensearch_integration_test.go
+++ b/opensearch_integration_test.go
@@ -41,9 +41,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 func TestClientTransport(t *testing.T) {
diff --git a/opensearch_internal_test.go b/opensearch_internal_test.go
index 264967e..b61bb06 100644
--- a/opensearch_internal_test.go
+++ b/opensearch_internal_test.go
@@ -42,7 +42,7 @@ import (
 
 	"github.com/stretchr/testify/assert"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var called bool
diff --git a/opensearch_secure_integration_test.go b/opensearch_secure_integration_test.go
index b4e40f8..3e0816a 100644
--- a/opensearch_secure_integration_test.go
+++ b/opensearch_secure_integration_test.go
@@ -18,7 +18,7 @@ import (
 	"net/http"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
+	"github.com/opensearch-project/opensearch-go/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/opensearchapi/opensearchapi.response_example_test.go b/opensearchapi/opensearchapi.response_example_test.go
index 3adcf25..d74f6e5 100644
--- a/opensearchapi/opensearchapi.response_example_test.go
+++ b/opensearchapi/opensearchapi.response_example_test.go
@@ -29,7 +29,7 @@ package opensearchapi_test
 import (
 	"log"
 
-	"github.com/opensearch-project/opensearch-go"
+	"github.com/opensearch-project/opensearch-go/v2"
 )
 
 func ExampleResponse_IsError() {
diff --git a/opensearchapi/opensearchapi_benchmark_test.go b/opensearchapi/opensearchapi_benchmark_test.go
index 1b66424..2462760 100644
--- a/opensearchapi/opensearchapi_benchmark_test.go
+++ b/opensearchapi/opensearchapi_benchmark_test.go
@@ -34,8 +34,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 // TODO: Refactor into a shared mock/testing package
diff --git a/opensearchapi/opensearchapi_integration_test.go b/opensearchapi/opensearchapi_integration_test.go
index 772c13b..218ce86 100644
--- a/opensearchapi/opensearchapi_integration_test.go
+++ b/opensearchapi/opensearchapi_integration_test.go
@@ -36,8 +36,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
 )
 
 func TestAPI(t *testing.T) {
diff --git a/opensearchapi/test/go.mod b/opensearchapi/test/go.mod
index d9b614f..6350a5b 100644
--- a/opensearchapi/test/go.mod
+++ b/opensearchapi/test/go.mod
@@ -1,11 +1,11 @@
-module github.com/opensearch-project/opensearch-go/opensearch/test
+module github.com/opensearch-project/opensearch-go/v2/opensearch/test
 
 go 1.11
 
-replace github.com/opensearch-project/opensearch-go => ../../
+replace github.com/opensearch-project/opensearch-go/v2 => ../../
 
 require (
-	github.com/opensearch-project/opensearch-go v1.0.0
+	github.com/opensearch-project/opensearch-go/v2 v2.0.0
 
 	gopkg.in/yaml.v2 v2.4.0
 )
diff --git a/opensearchtransport/logger_benchmark_test.go b/opensearchtransport/logger_benchmark_test.go
index 965ced4..3ed3111 100644
--- a/opensearchtransport/logger_benchmark_test.go
+++ b/opensearchtransport/logger_benchmark_test.go
@@ -35,7 +35,7 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 func BenchmarkTransportLogger(b *testing.B) {
diff --git a/opensearchtransport/opensearchtransport_benchmark_test.go b/opensearchtransport/opensearchtransport_benchmark_test.go
index eb137fa..6730cab 100644
--- a/opensearchtransport/opensearchtransport_benchmark_test.go
+++ b/opensearchtransport/opensearchtransport_benchmark_test.go
@@ -35,7 +35,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var defaultResponse = http.Response{
diff --git a/opensearchtransport/opensearchtransport_integration_multinode_test.go b/opensearchtransport/opensearchtransport_integration_multinode_test.go
index d9e80ac..d8dcb5b 100644
--- a/opensearchtransport/opensearchtransport_integration_multinode_test.go
+++ b/opensearchtransport/opensearchtransport_integration_multinode_test.go
@@ -35,7 +35,7 @@ import (
 	"net/url"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var (
diff --git a/opensearchtransport/opensearchtransport_integration_test.go b/opensearchtransport/opensearchtransport_integration_test.go
index ed820f5..024da3a 100644
--- a/opensearchtransport/opensearchtransport_integration_test.go
+++ b/opensearchtransport/opensearchtransport_integration_test.go
@@ -39,8 +39,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 var (
diff --git a/opensearchutil/bulk_indexer_benchmark_test.go b/opensearchutil/bulk_indexer_benchmark_test.go
index 5581b6b..a2dcd56 100644
--- a/opensearchutil/bulk_indexer_benchmark_test.go
+++ b/opensearchutil/bulk_indexer_benchmark_test.go
@@ -37,8 +37,8 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 var mockResponseBody = `{
diff --git a/opensearchutil/bulk_indexer_example_test.go b/opensearchutil/bulk_indexer_example_test.go
index 609412e..f519f37 100644
--- a/opensearchutil/bulk_indexer_example_test.go
+++ b/opensearchutil/bulk_indexer_example_test.go
@@ -35,8 +35,8 @@ import (
 	"strings"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 func ExampleNewBulkIndexer() {
diff --git a/opensearchutil/bulk_indexer_integration_test.go b/opensearchutil/bulk_indexer_integration_test.go
index 918461e..3d8d00f 100644
--- a/opensearchutil/bulk_indexer_integration_test.go
+++ b/opensearchutil/bulk_indexer_integration_test.go
@@ -38,9 +38,9 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 func TestBulkIndexerIntegration(t *testing.T) {
diff --git a/opensearchutil/bulk_indexer_internal_test.go b/opensearchutil/bulk_indexer_internal_test.go
index 916441c..a5c909b 100644
--- a/opensearchutil/bulk_indexer_internal_test.go
+++ b/opensearchutil/bulk_indexer_internal_test.go
@@ -47,8 +47,8 @@ import (
 	"testing"
 	"time"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchtransport"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchtransport"
 )
 
 var infoBody = `{
diff --git a/opensearchutil/json_reader_benchmark_test.go b/opensearchutil/json_reader_benchmark_test.go
index 0633dca..24c489e 100644
--- a/opensearchutil/json_reader_benchmark_test.go
+++ b/opensearchutil/json_reader_benchmark_test.go
@@ -37,7 +37,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 var _ = fmt.Print
diff --git a/opensearchutil/json_reader_integration_test.go b/opensearchutil/json_reader_integration_test.go
index fe55a4a..389626a 100644
--- a/opensearchutil/json_reader_integration_test.go
+++ b/opensearchutil/json_reader_integration_test.go
@@ -32,9 +32,9 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/opensearch-project/opensearch-go"
-	"github.com/opensearch-project/opensearch-go/opensearchapi"
-	"github.com/opensearch-project/opensearch-go/opensearchutil"
+	"github.com/opensearch-project/opensearch-go/v2"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchapi"
+	"github.com/opensearch-project/opensearch-go/v2/opensearchutil"
 )
 
 func TestJSONReaderIntegration(t *testing.T) {