Skip to content

Commit

Permalink
Use github.com/k1LoW/errors
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Aug 11, 2024
1 parent 5c56fff commit b2a8a98
Show file tree
Hide file tree
Showing 31 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cmd/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"os"
"path/filepath"

"github.com/pkg/errors"
"github.com/k1LoW/errors"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/coverage.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import (
"fmt"
"os"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/cmdutil"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/coverage"
"github.com/labstack/gommon/color"
"github.com/mattn/go-runewidth"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ import (
"path/filepath"
"strings"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/cmdutil"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/datasource"
"github.com/k1LoW/tbls/output/gviz"
"github.com/k1LoW/tbls/output/json"
"github.com/k1LoW/tbls/output/md"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import (
"os"
"reflect"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/cmdutil"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/datasource"
"github.com/labstack/gommon/color"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/out.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"io"
"os"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/cmdutil"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output"
Expand All @@ -36,7 +37,6 @@ import (
"github.com/k1LoW/tbls/output/plantuml"
"github.com/k1LoW/tbls/output/xlsx"
"github.com/k1LoW/tbls/output/yaml"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import (
"strconv"
"strings"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/cmdutil"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output/json"
Expand Down Expand Up @@ -271,7 +272,7 @@ func printError(err error) {
env := os.Getenv("DEBUG")
debug, _ := strconv.ParseBool(env)
if env != "" && debug {
fmt.Printf("%+v\n", err)
fmt.Println(errors.StackTraces(err))
} else {
fmt.Println(err)
}
Expand Down
2 changes: 1 addition & 1 deletion cmdutil/when.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/expr-lang/expr"
"github.com/expr-lang/expr/ast"
"github.com/pkg/errors"
"github.com/k1LoW/errors"
)

// AST walker which replaces `$IDENTIFIER` with `Env.IDENTIFIER` member lookup expressions.
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import (

"github.com/aquasecurity/go-version/pkg/version"
"github.com/goccy/go-yaml"
"github.com/k1LoW/errors"
"github.com/k1LoW/expand"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
ver "github.com/k1LoW/tbls/version"
"github.com/minio/pkg/wildcard"
"github.com/pkg/errors"
"github.com/samber/lo"
)

Expand Down
2 changes: 1 addition & 1 deletion datasource/datasource.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"time"

"github.com/k1LoW/errors"
"github.com/k1LoW/ghfs"
"github.com/k1LoW/go-github-client/v58/factory"
"github.com/k1LoW/tbls/config"
Expand All @@ -23,7 +24,6 @@ import (
"github.com/k1LoW/tbls/drivers/snowflake"
"github.com/k1LoW/tbls/drivers/sqlite"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"github.com/xo/dburl"
)

Expand Down
2 changes: 1 addition & 1 deletion drivers/bq/bq.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"

"cloud.google.com/go/bigquery"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/ddl"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

// Bigquery struct
Expand Down
2 changes: 1 addition & 1 deletion drivers/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"regexp"

_ "github.com/ClickHouse/clickhouse-go/v2"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"github.com/samber/lo"
)

Expand Down
5 changes: 3 additions & 2 deletions drivers/clickhouse/clickhouse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ package clickhouse
import (
"database/sql"
"fmt"
"github.com/k1LoW/tbls/schema"
"github.com/xo/dburl"
"os"
"testing"

"github.com/k1LoW/tbls/schema"
"github.com/xo/dburl"
)

var db *sql.DB
Expand Down
2 changes: 1 addition & 1 deletion drivers/dynamo/dynamo.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"regexp"

"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

var re = regexp.MustCompile(`(?s)\n\s*`)
Expand Down
2 changes: 1 addition & 1 deletion drivers/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"sort"
"strings"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
Expand Down
2 changes: 1 addition & 1 deletion drivers/mssql/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strconv"
"strings"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/ddl"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

var defaultSchemaName = "dbo"
Expand Down
2 changes: 1 addition & 1 deletion drivers/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"strings"

"github.com/aquasecurity/go-version/pkg/version"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/ddl"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/drivers"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

var reFK = regexp.MustCompile(`FOREIGN KEY \((.+)\) REFERENCES ([^\s\)]+)\s?\(([^\)]+)\)`)
Expand Down
2 changes: 1 addition & 1 deletion drivers/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import (
"strings"

"github.com/aquasecurity/go-version/pkg/version"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/ddl"
"github.com/k1LoW/tbls/dict"
"github.com/k1LoW/tbls/schema"
"github.com/lib/pq"
"github.com/pkg/errors"
)

var reFK = regexp.MustCompile(`FOREIGN KEY \((.+)\) REFERENCES ([^\s\)]+)\s?\(([^\)]+)\)`)
Expand Down
2 changes: 1 addition & 1 deletion drivers/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package snowflake
import (
"database/sql"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
_ "github.com/snowflakedb/gosnowflake"
)

Expand Down
2 changes: 1 addition & 1 deletion drivers/spanner/spanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"

"cloud.google.com/go/spanner"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"google.golang.org/api/iterator"
)

Expand Down
2 changes: 1 addition & 1 deletion drivers/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"regexp"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/ddl"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"github.com/samber/lo"
)

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/goccy/go-yaml v1.12.0
github.com/google/go-cmp v0.6.0
github.com/k1LoW/duration v1.2.0
github.com/k1LoW/errors v0.2.1
github.com/k1LoW/expand v0.12.0
github.com/k1LoW/ffff v0.2.0
github.com/k1LoW/ghfs v1.3.1
Expand All @@ -28,7 +29,6 @@ require (
github.com/microsoft/go-mssqldb v1.7.2
github.com/minio/pkg v1.7.5
github.com/olekukonko/tablewriter v0.0.5
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/samber/lo v1.46.0
github.com/snowflakedb/gosnowflake v1.10.1
Expand Down Expand Up @@ -124,6 +124,7 @@ require (
github.com/paulmach/orb v0.11.1 // indirect
github.com/pierrec/lz4/v4 v4.1.21 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/sahilm/fuzzy v0.1.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -992,6 +992,8 @@ github.com/jung-kurt/gofpdf v1.0.0/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
github.com/k1LoW/duration v1.2.0 h1:qq1gWtPh7YROFyerBufVP+ATR11mOOHDInrcC/Xe/6A=
github.com/k1LoW/duration v1.2.0/go.mod h1:qUa0NptIiUl5EUsCc8wIiSaHuNjS4wmpYNMHp0l6pos=
github.com/k1LoW/errors v0.2.1 h1:HHdnTugYfmZL4QsbVhcYNlQxVC1ExsEp7q7Npdxvqoc=
github.com/k1LoW/errors v0.2.1/go.mod h1:sNlL6+/dTai2f2R7/vcDMMRlrd/C7kXONQT81b2kZPY=
github.com/k1LoW/expand v0.12.0 h1:EfkT/VoGVe/B6Jo8WYS5dliXOPJ0xkdkGfzOQPl+0Y8=
github.com/k1LoW/expand v0.12.0/go.mod h1:jJkWgMSibfX88Q+4m4Jse6FQP62M4ia2YaQWQKmD4nA=
github.com/k1LoW/ffff v0.2.0 h1:k5IYb2ggSKrkgVRkFnn1fs4xVUkJxanTH5gInmEKTDA=
Expand Down
2 changes: 1 addition & 1 deletion output/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"io"

"github.com/goccy/go-yaml"
"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

const NoTableComment = "table comment required."
Expand Down
2 changes: 1 addition & 1 deletion output/dot/dot.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"text/template"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"github.com/samber/lo"
)

Expand Down
2 changes: 1 addition & 1 deletion output/gviz/gviz.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (

"github.com/beta/freetype/truetype"
"github.com/goccy/go-graphviz"
"github.com/k1LoW/errors"
"github.com/k1LoW/ffff"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output/dot"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
"golang.org/x/image/font"
"golang.org/x/image/font/opentype"
"golang.org/x/image/font/sfnt"
Expand Down
2 changes: 1 addition & 1 deletion output/md/md.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import (
"strings"
"text/template"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output"
"github.com/k1LoW/tbls/output/mermaid"
"github.com/k1LoW/tbls/schema"
"github.com/mattn/go-runewidth"
"github.com/pkg/errors"
"github.com/pmezard/go-difflib/difflib"
"github.com/samber/lo"
"gitlab.com/golang-commonmark/mdurl"
Expand Down
2 changes: 1 addition & 1 deletion output/mermaid/mermaid.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"text/template"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

//go:embed templates/*
Expand Down
2 changes: 1 addition & 1 deletion output/plantuml/plantuml.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import (
"os"
"text/template"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/output"
"github.com/k1LoW/tbls/schema"
"github.com/pkg/errors"
)

//go:embed templates/*
Expand Down
2 changes: 1 addition & 1 deletion output/xlsx/xlsx.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"strings"
"unicode/utf8"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/config"
"github.com/k1LoW/tbls/schema"
"github.com/loadoff/excl"
"github.com/pkg/errors"
)

// Xlsx struct
Expand Down
2 changes: 1 addition & 1 deletion schema/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"fmt"
"strings"

"github.com/k1LoW/errors"
"github.com/minio/pkg/wildcard"
"github.com/pkg/errors"
"github.com/samber/lo"
)

Expand Down
2 changes: 1 addition & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sort"
"strings"

"github.com/k1LoW/errors"
"github.com/k1LoW/tbls/dict"
"github.com/pkg/errors"
"github.com/samber/lo"
)

Expand Down

0 comments on commit b2a8a98

Please sign in to comment.