Skip to content

Commit

Permalink
change imports for v1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Miguel Molina committed Feb 22, 2017
1 parent 7c38928 commit 1479e9e
Show file tree
Hide file tree
Showing 29 changed files with 73 additions and 67 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Expand Up @@ -2,6 +2,7 @@ language: go

go:
- 1.7
- 1.8
- tip

matrix:
Expand All @@ -21,8 +22,12 @@ before_script:
- psql -c 'create database kallax_test;' -U postgres

install:
- go get -t -v .
- go get -t -v ./generator/...
- rm -rf $GOPATH/src/gopkg.in/src-d
- mkdir -p $GOPATH/src/gopkg.in/src-d
- mv $PWD $GOPATH/src/gopkg.in/src-d/go-kallax.v1
- cd $GOPATH/src/gopkg.in/src-d/go-kallax.v1
- go get -v -t .
- go get -v -t ./generator/...

script:
- make test
Expand Down
1 change: 1 addition & 0 deletions Makefile
Expand Up @@ -20,6 +20,7 @@ test:
done; \
go install ./generator/...; \
go generate ./tests/...; \
git diff --no-prefix -U1000; \
if [ `git status | grep 'Changes not staged for commit' | wc -l` != '0' ]; then \
echo 'There are differences between the commited tests/kallax.go and the one generated right now'; \
exit 2; \
Expand Down
4 changes: 2 additions & 2 deletions README.md
@@ -1,7 +1,7 @@
<img src="https://cdn.rawgit.com/src-d/go-kallax/master/kallax.svg" width="400" />
=============================

[![GoDoc](https://godoc.org/github.com/src-d/go-kallax?status.svg)](https://godoc.org/github.com/src-d/go-kallax) [![Build Status](https://travis-ci.org/src-d/go-kallax.svg?branch=master)](https://travis-ci.org/src-d/go-kallax) [![codecov](https://codecov.io/gh/src-d/go-kallax/branch/master/graph/badge.svg)](https://codecov.io/gh/src-d/go-kallax) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-kallax)](https://goreportcard.com/report/github.com/src-d/go-kallax) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![GoDoc](https://godoc.org/gopkg.in/src-d/go-kallax.v1?status.svg)](https://godoc.org/gopkg.in/src-d/go-kallax.v1) [![Build Status](https://travis-ci.org/src-d/go-kallax.svg?branch=master)](https://travis-ci.org/src-d/go-kallax) [![codecov](https://codecov.io/gh/src-d/go-kallax/branch/master/graph/badge.svg)](https://codecov.io/gh/src-d/go-kallax) [![Go Report Card](https://goreportcard.com/badge/github.com/src-d/go-kallax)](https://goreportcard.com/report/github.com/src-d/go-kallax) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


Kallax is a PostgreSQL typesafe ORM for the Go language.
Expand Down Expand Up @@ -42,7 +42,7 @@ Support for arrays of all basic Go types and all JSON and arrays operators is pr
The recommended way to install `kallax` is:

```
go get -u github.com/src-d/kallax/...
go get -u gopkg.in/src-d/kallax.v1/...
```

> *kallax* includes a binary tool used by [go generate](http://blog.golang.org/generate),
Expand Down
2 changes: 1 addition & 1 deletion doc.go
Expand Up @@ -10,4 +10,4 @@
// for example, `sql.NullInt64`.
// Support for arrays of all basic Go types and all JSON and arrays operators is
// provided as well.
package kallax
package kallax // import "gopkg.in/src-d/go-kallax.v1"
2 changes: 1 addition & 1 deletion generator/cli/kallax/cmd.go
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"path/filepath"

"github.com/src-d/go-kallax/generator"
"gopkg.in/src-d/go-kallax.v1/generator"

"gopkg.in/urfave/cli.v1"
)
Expand Down
2 changes: 1 addition & 1 deletion generator/generator.go
@@ -1,6 +1,6 @@
// Package generator implements the processor of source code and generator of
// kallax models based on Go source code.
package generator
package generator // import "gopkg.in/src-d/go-kallax.v1/generator"

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion generator/processor.go
Expand Up @@ -17,7 +17,7 @@ import (

const (
// BaseModel is the type name of the kallax base model.
BaseModel = "github.com/src-d/go-kallax.Model"
BaseModel = "gopkg.in/src-d/go-kallax.v1.Model"
//URL is the type name of the net/url.URL.
URL = "url.URL"
)
Expand Down
24 changes: 12 additions & 12 deletions generator/processor_test.go
Expand Up @@ -22,7 +22,7 @@ func (s *ProcessorSuite) TestInlineStruct() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Foo struct {}
Expand All @@ -42,7 +42,7 @@ func (s *ProcessorSuite) TestTags() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Foo struct {
kallax.Model
Expand All @@ -59,7 +59,7 @@ func (s *ProcessorSuite) TestRecursiveModel() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Recur struct {
kallax.Model
Expand All @@ -80,7 +80,7 @@ func (s *ProcessorSuite) TestDeepRecursiveStruct() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Recur struct {
kallax.Model
Expand Down Expand Up @@ -109,7 +109,7 @@ func (s *ProcessorSuite) TestIsEventPresent() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Foo struct {
kallax.Model
Expand Down Expand Up @@ -148,7 +148,7 @@ func (s *ProcessorSuite) TestProcessField() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "database/sql/driver"
type BasicAlias string
Expand Down Expand Up @@ -246,7 +246,7 @@ func (s *ProcessorSuite) TestCtor() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Foo struct {
kallax.Model
Expand All @@ -269,7 +269,7 @@ func (s *ProcessorSuite) TestSQLTypeIsInterface() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "database/sql/driver"
type Foo struct {
Expand Down Expand Up @@ -298,7 +298,7 @@ func (s *ProcessorSuite) TestIsSQLType() {
fixtureSrc := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type SQLTypeFixture struct {
kallax.Model
Expand Down Expand Up @@ -340,7 +340,7 @@ func (s *ProcessorSuite) processFixture(source string) *Package {
}

func (s *ProcessorSuite) TestDo() {
p := NewProcessor(filepath.Join(goPath, "src", "github.com/src-d/go-kallax"), []string{"README.md"})
p := NewProcessor(filepath.Join(goPath, "src", "gopkg.in/src-d/go-kallax.v1"), []string{"README.md"})
pkg, err := p.Do()
s.NotNil(pkg)
s.NoError(err)
Expand All @@ -350,7 +350,7 @@ func (s *ProcessorSuite) TestIsModel() {
src := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Bar struct {
kallax.Model
Expand Down Expand Up @@ -392,7 +392,7 @@ func (s *ProcessorSuite) TestIsEmbedded() {
src := `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
type Bar struct {
kallax.Model
Expand Down
2 changes: 1 addition & 1 deletion generator/template.go
Expand Up @@ -425,7 +425,7 @@ func printDocumentWithNumbers(code string) {
}

func loadTemplateText(filename string) string {
filename = filepath.Join(build.Default.GOPATH, "src/github.com/src-d/go-kallax/generator", filename)
filename = filepath.Join(build.Default.GOPATH, "src/gopkg.in/src-d/go-kallax.v1/generator", filename)
f, err := os.Open(filename)
if err != nil {
panic(err)
Expand Down
22 changes: 11 additions & 11 deletions generator/template_test.go
Expand Up @@ -71,7 +71,7 @@ return kallax.VirtualColumn("foo_id", r, new(kallax.NumericID)), nil
const baseTpl = `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "net/url"
type Rel struct {
Expand Down Expand Up @@ -143,7 +143,7 @@ func (s *TemplateSuite) TestGenColumnValues() {
s.processSource(`
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "net/url"
type Aliased string
Expand Down Expand Up @@ -201,7 +201,7 @@ func (s *TemplateSuite) TestGenModelColumns() {
const jsonBaseTpl = `
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "net/url"
type Rel struct {
Expand Down Expand Up @@ -337,7 +337,7 @@ func (s *TemplateSuite) TestGenTypeName() {
s.processSource(`
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "net/url"
type Foo struct {
Expand Down Expand Up @@ -372,7 +372,7 @@ func (s *TemplateSuite) TestIsPtrSlice() {
s.processSource(`
package fixture
import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"
import "net/url"
type Foo struct {
Expand Down Expand Up @@ -425,8 +425,8 @@ func (s *ProcessorSuite) TestFindableTypeName() {
import "time"
import "net/url"
import "github.com/src-d/go-kallax"
import "github.com/src-d/go-kallax/tests/fixtures"
import "gopkg.in/src-d/go-kallax.v1"
import "gopkg.in/src-d/go-kallax.v1/tests/fixtures"
type mainFixture struct {
kallax.Model
Expand Down Expand Up @@ -522,8 +522,8 @@ func (s *ProcessorSuite) TestLookupValid() {
import "time"
import "net/url"
import "github.com/src-d/go-kallax"
import "github.com/src-d/go-kallax/tests/fixtures"
import "gopkg.in/src-d/go-kallax.v1"
import "gopkg.in/src-d/go-kallax.v1/tests/fixtures"
type mainFixture struct {
kallax.Model
Expand Down Expand Up @@ -638,8 +638,8 @@ func (s *ProcessorSuite) TestShortName() {
import "time"
import "net/url"
import "github.com/src-d/go-kallax"
import "github.com/src-d/go-kallax/tests/fixtures"
import "gopkg.in/src-d/go-kallax.v1"
import "gopkg.in/src-d/go-kallax.v1/tests/fixtures"
type mainFixture struct {
kallax.Model
Expand Down
4 changes: 2 additions & 2 deletions generator/templates/base.tgo
Expand Up @@ -5,8 +5,8 @@
package {{.Name}}

import (
"github.com/src-d/go-kallax"
"github.com/src-d/go-kallax/types"
"gopkg.in/src-d/go-kallax.v1"
"gopkg.in/src-d/go-kallax.v1/types"
"database/sql"
"database/sql/driver"
"fmt"
Expand Down
20 changes: 10 additions & 10 deletions generator/types.go
Expand Up @@ -107,12 +107,12 @@ var reservedKeywords = map[string]struct{}{
// special types that are not analyzed because SQL already knows
// how to handle them
var specialTypes = map[string]string{
"github.com/src-d/go-kallax.UUID": "kallax.UUID",
"github.com/src-d/go-kallax.ULID": "kallax.ULID",
"github.com/src-d/go-kallax.NumericID": "kallax.NumericID",
"github.com/satori/go.uuid.UUID": "kallax.UUID",
"net/url.URL": "url.URL",
"time.Time": "time.Time",
"gopkg.in/src-d/go-kallax.v1.UUID": "kallax.UUID",
"gopkg.in/src-d/go-kallax.v1.ULID": "kallax.ULID",
"gopkg.in/src-d/go-kallax.v1.NumericID": "kallax.NumericID",
"github.com/satori/go.uuid.UUID": "kallax.UUID",
"net/url.URL": "url.URL",
"time.Time": "time.Time",
}

// mappings defines the mapping between specific types and their counterpart
Expand Down Expand Up @@ -758,10 +758,10 @@ func (f *Field) TypeSchemaName() string {
}

var identifierTypes = map[string]string{
"github.com/src-d/go-kallax.UUID": "kallax.UUID",
"github.com/src-d/go-kallax.ULID": "kallax.ULID",
"github.com/src-d/go-kallax.NumericID": "kallax.NumericID",
"github.com/satori/go.uuid.UUID": "kallax.UUID",
"gopkg.in/src-d/go-kallax.v1.UUID": "kallax.UUID",
"gopkg.in/src-d/go-kallax.v1.ULID": "kallax.ULID",
"gopkg.in/src-d/go-kallax.v1.NumericID": "kallax.NumericID",
"github.com/satori/go.uuid.UUID": "kallax.UUID",
"int64": "kallax.NumericID",
}

Expand Down
2 changes: 1 addition & 1 deletion generator/types_test.go
Expand Up @@ -207,7 +207,7 @@ import (
"errors"
"strings"
kallax "github.com/src-d/go-kallax"
kallax "gopkg.in/src-d/go-kallax.v1"
)
type User struct {
Expand Down
2 changes: 1 addition & 1 deletion operators.go
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"strings"

"github.com/src-d/go-kallax/types"
"gopkg.in/src-d/go-kallax.v1/types"

"github.com/Masterminds/squirrel"
)
Expand Down
2 changes: 1 addition & 1 deletion operators_test.go
Expand Up @@ -4,8 +4,8 @@ import (
"database/sql"
"testing"

"github.com/src-d/go-kallax/types"
"github.com/stretchr/testify/suite"
"gopkg.in/src-d/go-kallax.v1/types"
)

type OpsSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion resultset.go
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"io"

"github.com/src-d/go-kallax/types"
"gopkg.in/src-d/go-kallax.v1/types"
)

// ResultSet is the common interface all result sets need to implement.
Expand Down
2 changes: 1 addition & 1 deletion tests/events.go
@@ -1,6 +1,6 @@
package tests

import "github.com/src-d/go-kallax"
import "gopkg.in/src-d/go-kallax.v1"

type EventsFixture struct {
kallax.Model `table:"event"`
Expand Down
2 changes: 1 addition & 1 deletion tests/json.go
@@ -1,6 +1,6 @@
package tests

import kallax "github.com/src-d/go-kallax"
import kallax "gopkg.in/src-d/go-kallax.v1"

type JSONModel struct {
kallax.Model `table:"jsons"`
Expand Down
2 changes: 1 addition & 1 deletion tests/json_test.go
Expand Up @@ -3,8 +3,8 @@ package tests
import (
"testing"

kallax "github.com/src-d/go-kallax"
"github.com/stretchr/testify/suite"
kallax "gopkg.in/src-d/go-kallax.v1"
)

type JSONSuite struct {
Expand Down
6 changes: 3 additions & 3 deletions tests/kallax.go
Expand Up @@ -10,9 +10,9 @@ import (
"net/url"
"time"

"github.com/src-d/go-kallax"
"github.com/src-d/go-kallax/tests/fixtures"
"github.com/src-d/go-kallax/types"
"gopkg.in/src-d/go-kallax.v1"
"gopkg.in/src-d/go-kallax.v1/tests/fixtures"
"gopkg.in/src-d/go-kallax.v1/types"
)

var _ types.SQLType
Expand Down

0 comments on commit 1479e9e

Please sign in to comment.