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

Add Go Modules #170

Closed
wants to merge 4 commits into from
Closed
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
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
sudo: false
language: go
go:
- 1.9.x
- 1.10.x
- 1.11.x
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twirp promises to support the last two minor versions, just like Go's promise with security updates. We can't stop supporting go1.10.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Twirp promises to support the last two minor versions

Which patch versions of the minor versions? modules are only in the latest patch (1.9.7 not 1.9.6 for example) of older versions

- 1.12.x
- tip
env:
global:
- GO111MODULE=on
script:
- go install ./...
- go test -race ./...
2 changes: 1 addition & 1 deletion clientcompat/clientcompat.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package main
import (
"context"

"github.com/twitchtv/twirp/clientcompat/internal/clientcompat"
"github.com/twitchtv/twirp/v6/clientcompat/internal/clientcompat"
)

type clientCompat struct {
Expand Down
4 changes: 2 additions & 2 deletions clientcompat/gocompat/gocompat.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"os"

"github.com/golang/protobuf/proto"
"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/clientcompat/internal/clientcompat"
"github.com/twitchtv/twirp/v6"
"github.com/twitchtv/twirp/v6/clientcompat/internal/clientcompat"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions clientcompat/internal/clientcompat/clientcompat.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions clientcompat/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"os"
"reflect"

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/clientcompat/internal/clientcompat"
"github.com/twitchtv/twirp/v6"
"github.com/twitchtv/twirp/v6/clientcompat/internal/clientcompat"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion clientcompat/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

"github.com/gogo/protobuf/proto"
"github.com/pkg/errors"
"github.com/twitchtv/twirp/clientcompat/internal/clientcompat"
"github.com/twitchtv/twirp/v6/clientcompat/internal/clientcompat"
)

func runClient(clientBin string, msg *clientcompat.ClientCompatMessage) (resp []byte, errCode string, err error) {
Expand Down
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"errors"
"net/http"

"github.com/twitchtv/twirp/internal/contextkeys"
"github.com/twitchtv/twirp/v6/internal/contextkeys"
)

// MethodName extracts the name of the method being handled in the given
Expand Down
2 changes: 1 addition & 1 deletion ctxsetters/ctxsetters.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"net/http"
"strconv"

"github.com/twitchtv/twirp/internal/contextkeys"
"github.com/twitchtv/twirp/v6/internal/contextkeys"
)

func WithMethodName(ctx context.Context, name string) context.Context {
Expand Down
4 changes: 2 additions & 2 deletions example/cmd/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"log"
"net/http"

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/example"
"github.com/twitchtv/twirp/v6"
"github.com/twitchtv/twirp/v6/example"
)

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

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/example"
"github.com/twitchtv/twirp/hooks/statsd"
"github.com/twitchtv/twirp/v6"
"github.com/twitchtv/twirp/v6/example"
"github.com/twitchtv/twirp/v6/hooks/statsd"
)

type randomHaberdasher struct{}
Expand Down
4 changes: 2 additions & 2 deletions example/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module github.com/twitchtv/twirp/v6

go 1.12

require (
github.com/davecgh/go-spew v1.1.0
github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415
github.com/golang/protobuf v0.0.0-20180919224659-7716a980bcee
github.com/pkg/errors v0.8.0
github.com/pmezard/go-difflib v1.0.0
github.com/stretchr/testify v1.2.0
github.com/twitchtv/twirp v5.6.0+incompatible // indirect
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415 h1:WSBJMqJbLxsn+bTCPyPYZfqHdJmc8MK4wrBjMft6BAM=
github.com/gogo/protobuf v0.0.0-20171007142547-342cbe0a0415/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
github.com/golang/protobuf v0.0.0-20180919224659-7716a980bcee h1:5o3oVO7Gbd1wjnF3FTXCai8v+szwN6Jme/Er6tD7UyU=
github.com/golang/protobuf v0.0.0-20180919224659-7716a980bcee/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0=
github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.2.0 h1:LThGCOvhuJic9Gyd1VBCkhyUXmO8vKaBFvBsJ2k03rg=
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/twitchtv/twirp v5.6.0+incompatible h1:sUqlJqdfCAIPDShsmjo3Gixzccs1KWCtFctfpNYcnPE=
github.com/twitchtv/twirp v5.6.0+incompatible/go.mod h1:RRJoFSAmTEh2weEqWtpPE3vFK5YBhA6bqp2l1kfCC5A=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
2 changes: 1 addition & 1 deletion hooks/statsd/statsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"strings"
"time"

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/v6"
)

var reqStartTimestampKey = new(int)
Expand Down
4 changes: 2 additions & 2 deletions hooks/statsd/statsd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"testing"
"time"

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/internal/twirptest"
"github.com/twitchtv/twirp/v6"
"github.com/twitchtv/twirp/v6/internal/twirptest"
)

func TestSanitize(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions internal/gen/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import (

"github.com/golang/protobuf/protoc-gen-go/descriptor"
plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
"github.com/twitchtv/twirp/internal/gen/stringutils"
"github.com/twitchtv/twirp/v6/internal/gen/stringutils"
)

// Each type we import as a protocol buffer (other than FileDescriptorProto) needs
Expand Down Expand Up @@ -414,8 +414,8 @@ func wrapServices(file *descriptor.FileDescriptorProto) (sl []*ServiceDescriptor
sd := &ServiceDescriptor{
common: common{file},
ServiceDescriptorProto: svc,
Index: i,
Path: fmt.Sprintf("%d,%d", servicePath, i),
Index: i,
Path: fmt.Sprintf("%d,%d", servicePath, i),
}
for j, method := range svc.Method {
md := &MethodDescriptor{
Expand Down
2 changes: 1 addition & 1 deletion internal/twirptest/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"testing"

"github.com/pkg/errors"
"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/v6"
)

// reqInspector is a tool to check inspect HTTP Requests as they pass
Expand Down
2 changes: 1 addition & 1 deletion internal/twirptest/gogo_compat/gogo_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package gogo_compat
import (
"testing"

"github.com/twitchtv/twirp/internal/descriptors"
"github.com/twitchtv/twirp/v6/internal/descriptors"
)

func TestCompilation(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions internal/twirptest/gogo_compat/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/google_protobuf_imports/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/twirptest/hatmakers.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"net/http/httptest"
"time"

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/v6"
)

type hatmaker func(ctx context.Context, s *Size) (*Hat, error)
Expand Down
4 changes: 2 additions & 2 deletions internal/twirptest/importable/importable.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/twirptest/importer/importer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/twirptest/importer/importer.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/twirptest/importmapping/x/x.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/twirptest/importmapping/x/x.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/multiple/multiple1.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/multiple/multiple2.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/no_package_name/no_package_name.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/proto/proto.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/service.twirp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/twirptest/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ import (
"github.com/golang/protobuf/jsonpb"
pkgerrors "github.com/pkg/errors"

"github.com/twitchtv/twirp"
"github.com/twitchtv/twirp/internal/descriptors"
"github.com/twitchtv/twirp/v6"
"github.com/twitchtv/twirp/v6/internal/descriptors"
)

func TestServeJSON(t *testing.T) {
Expand Down
Loading