diff --git a/.travis.yml b/.travis.yml index b54e2c3..7d95fab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,16 @@ language: go - +cache: + directories: + - $GOPATH/pkg +before_install: + - export GOCACHE=$GOPATH/pkg/cache +install: + - go mod download +script: + - go test -v ./... + - go vet -v ./... +env: + global: + - GO111MODULE=on go: - - tip + - 1.x diff --git a/compiler/compiler.go b/compiler/compiler.go index 166ba78..e8da559 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -1,6 +1,6 @@ // Package compiler contains tools to take openapi.* definitions and // compile them into protobuf.* structures. -package compiler +package compiler // github.com/NYTimes/openapi2proto/compiler import ( "bytes" diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..e329919 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/NYTimes/openapi2proto + +go 1.12 + +require ( + github.com/dolmen-go/jsonptr v0.0.0-20190227181151-a830c2c3c0fe + github.com/pkg/errors v0.8.1 + github.com/pmezard/go-difflib v1.0.0 + gopkg.in/yaml.v2 v2.2.2 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..2bdd8ee --- /dev/null +++ b/go.sum @@ -0,0 +1,9 @@ +github.com/dolmen-go/jsonptr v0.0.0-20190227181151-a830c2c3c0fe h1:7UArST+CxXqtOBr8r+/jF8/jtP9I7CLMjYnLx/GEVH0= +github.com/dolmen-go/jsonptr v0.0.0-20190227181151-a830c2c3c0fe/go.mod h1:GG6FAkYtUFD/rqS31kfcho/lSCed6Gqm1X0uiIEU0tA= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/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= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/internal/option/option.go b/internal/option/option.go index 1dc8236..05328fa 100644 --- a/internal/option/option.go +++ b/internal/option/option.go @@ -1,4 +1,4 @@ -package option +package option // github.com/NYTimes/openapi2proto/internal/option type Option interface { Name() string diff --git a/openapi/interface.go b/openapi/interface.go index 921f4d7..bcf528f 100644 --- a/openapi/interface.go +++ b/openapi/interface.go @@ -81,7 +81,7 @@ type Parameter struct { Name string `yaml:"name" json:"name"` Description string `yaml:"description" json:"description"` Enum []string `yaml:"enum,omitempty" json:"enum,omitempty"` - Format string `yaml:"format,omitempty", json:"format,omitempty"` + Format string `yaml:"format,omitempty" json:"format,omitempty"` In string `yaml:"in,omitempty" json:"in,omitempty"` Items *Schema `yaml:"items,omitempty" json:"items,omitempty"` ProtoTag int `yaml:"x-proto-tag" json:"x-proto-tag"` diff --git a/openapi/openapi.go b/openapi/openapi.go index 90cd0e8..6df002e 100644 --- a/openapi/openapi.go +++ b/openapi/openapi.go @@ -1,6 +1,6 @@ // Package openapi contains tools to read in OpenAPI specifications // so that they can be passed to the openapi2proto compiler -package openapi +package openapi // github.com/NYTimes/openapi2proto/openapi import ( "bytes" diff --git a/protobuf/protobuf.go b/protobuf/protobuf.go index 9a780cb..d9ff726 100644 --- a/protobuf/protobuf.go +++ b/protobuf/protobuf.go @@ -1,4 +1,4 @@ // Package protobuf contains structures to represent a protobuf // definition, and tools to create textual representation of the // definition. -package protobuf \ No newline at end of file +package protobuf // github.com/NYTimes/openapi2proto/protobuf diff --git a/transpiler.go b/transpiler.go index 304bbdf..0a77e69 100644 --- a/transpiler.go +++ b/transpiler.go @@ -1,4 +1,4 @@ -package openapi2proto +package openapi2proto // github.com/NYTimes/openapi2proto import ( "io"