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

Use google/uuid rather than twinj/uuid #141

Merged
merged 1 commit into from
May 20, 2024
Merged
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
4 changes: 2 additions & 2 deletions builder/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ package builder

import (
"fmt"
"github.com/google/uuid"
v3 "github.com/pb33f/libopenapi/datamodel/low/v3"
wcModel "github.com/pb33f/libopenapi/what-changed/model"
"github.com/pb33f/openapi-changes/model"
"github.com/twinj/uuid"
"reflect"
"strings"
)
Expand Down Expand Up @@ -227,7 +227,7 @@ func exploreGraphObject(parent *model.NodeData[any], object any, nodes *[]*model
}

func buildId(label string) string {
return fmt.Sprintf("%s-%s", strings.ToLower(label), uuid.NewV4().String()[:6])
return fmt.Sprintf("%s-%s", strings.ToLower(label), uuid.New().String()[:6])
}

func calcWidth(label string) int {
Expand Down
10 changes: 5 additions & 5 deletions builder/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
package builder

import (
"github.com/google/uuid"
v3 "github.com/pb33f/libopenapi/datamodel/low/v3"
wcModel "github.com/pb33f/libopenapi/what-changed/model"
"github.com/pb33f/libopenapi/what-changed/reports"
"github.com/pb33f/openapi-changes/model"
"github.com/twinj/uuid"
"golang.org/x/text/cases"
"golang.org/x/text/language"
"reflect"
Expand Down Expand Up @@ -86,7 +86,7 @@ func exploreTreeObject(parent *model.TreeNode, object any) {

parent.Children = append(parent.Children, &model.TreeNode{
TitleString: title,
Key: uuid.NewV4().String(),
Key: uuid.New().String(),
Change: topChanges[x],
IsLeaf: true,
Selectable: true,
Expand Down Expand Up @@ -290,7 +290,7 @@ func DigIntoTreeNode[T any](parent *model.TreeNode, field reflect.Value, label s
if !field.IsZero() {
e := &model.TreeNode{
TitleString: label,
Key: uuid.NewV4().String(),
Key: uuid.New().String(),
IsLeaf: false,
Selectable: false,
TotalChanges: tc,
Expand All @@ -309,7 +309,7 @@ func DigIntoTreeNodeSlice[T any](parent *model.TreeNode, field reflect.Value, la
f := field.Index(k)
e := &model.TreeNode{
TitleString: label,
Key: uuid.NewV4().String(),
Key: uuid.New().String(),
IsLeaf: false,
Selectable: false,
Disabled: false,
Expand All @@ -336,7 +336,7 @@ func BuildTreeMapNode(parent *model.TreeNode, field reflect.Value) {
default:
tn := &model.TreeNode{
TitleString: e.String(),
Key: uuid.NewV4().String(),
Key: uuid.New().String(),
IsLeaf: false,
Selectable: false,
Disabled: false,
Expand Down
6 changes: 3 additions & 3 deletions cmd/console.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"path/filepath"
"time"

"github.com/google/uuid"
"github.com/pb33f/openapi-changes/git"
"github.com/pb33f/openapi-changes/model"
"github.com/pb33f/openapi-changes/tui"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"github.com/twinj/uuid"
)

func GetConsoleCommand() *cobra.Command {
Expand Down Expand Up @@ -360,13 +360,13 @@ func runLeftRightCompare(left, right string, updateChan chan *model.ProgressUpda

commits := []*model.Commit{
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("New: %s, Original: %s", right, left),
CommitDate: time.Now(),
Data: rightBytes,
},
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("Original file: %s", left),
CommitDate: time.Now(),
Data: leftBytes,
Expand Down
10 changes: 5 additions & 5 deletions cmd/html_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/google/uuid"
"github.com/pb33f/libopenapi/index"
"github.com/pb33f/openapi-changes/git"
htmlReport "github.com/pb33f/openapi-changes/html-report"
"github.com/pb33f/openapi-changes/model"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"github.com/twinj/uuid"
"net/url"
"os"
"path/filepath"
Expand Down Expand Up @@ -410,13 +410,13 @@ func RunLeftRightHTMLReport(left, right string, useCDN bool,

commits := []*model.Commit{
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("New: %s, Original: %s", right, left),
CommitDate: time.Now(),
Data: rightBytes,
},
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("Original file: %s", left),
CommitDate: time.Now(),
Data: leftBytes,
Expand All @@ -442,13 +442,13 @@ func RunLeftRightHTMLReportViaString(left, right string, useCDN, embedded bool,

commits := []*model.Commit{
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("Uploaded original (%d bytes)", len(left)),
CommitDate: time.Now(),
Data: []byte(left),
},
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("Uploaded modification (%d bytes)", len(right)),
CommitDate: time.Now(),
Data: []byte(right),
Expand Down
6 changes: 3 additions & 3 deletions cmd/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
"path/filepath"
"time"

"github.com/google/uuid"
"github.com/pb33f/libopenapi/what-changed/reports"
"github.com/pb33f/openapi-changes/git"
"github.com/pb33f/openapi-changes/model"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"github.com/twinj/uuid"
)

func GetReportCommand() *cobra.Command {
Expand Down Expand Up @@ -338,13 +338,13 @@ func runLeftRightReport(left, right string,

commits := []*model.Commit{
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("New: %s, Original: %s", right, left),
CommitDate: time.Now(),
Data: rightBytes,
},
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("Original file: %s", left),
CommitDate: time.Now(),
Data: leftBytes,
Expand Down
6 changes: 3 additions & 3 deletions cmd/summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ import (
"strings"
"time"

"github.com/google/uuid"
"github.com/pb33f/libopenapi/what-changed/reports"
"github.com/pb33f/openapi-changes/git"
"github.com/pb33f/openapi-changes/model"
"github.com/pterm/pterm"
"github.com/spf13/cobra"
"github.com/twinj/uuid"
)

func GetSummaryCommand() *cobra.Command {
Expand Down Expand Up @@ -314,13 +314,13 @@ func runLeftRightSummary(left, right string, updateChan chan *model.ProgressUpda

commits := []*model.Commit{
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("New: %s, Original: %s", right, left),
CommitDate: time.Now(),
Data: rightBytes,
},
{
Hash: uuid.NewV4().String()[:6],
Hash: uuid.New().String()[:6],
Message: fmt.Sprintf("Original file: %s", left),
CommitDate: time.Now(),
Data: leftBytes,
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ go 1.21
require (
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
github.com/gdamore/tcell/v2 v2.7.4
github.com/google/uuid v1.6.0
github.com/pb33f/libopenapi v0.16.2
github.com/pterm/pterm v0.12.79
github.com/rivo/tview v0.0.0-20240424133105-0d02bb78244d
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
github.com/twinj/uuid v1.0.0
golang.org/x/text v0.14.0
)

Expand All @@ -31,7 +31,6 @@ require (
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/myesui/uuid v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -43,6 +42,5 @@ require (
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/stretchr/testify.v1 v1.2.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
8 changes: 2 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/gookit/color v1.4.2/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ=
github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo=
github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
Expand Down Expand Up @@ -88,8 +90,6 @@ github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRC
github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/myesui/uuid v1.0.0 h1:xCBmH4l5KuvLYc5L7AS7SZg9/jKdIFubM7OVoLqaQUI=
github.com/myesui/uuid v1.0.0/go.mod h1:2CDfNgU0LR8mIdO8vdWd8i9gWWxLlcoIGGpSNgafq84=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down Expand Up @@ -141,8 +141,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/twinj/uuid v1.0.0 h1:fzz7COZnDrXGTAOHGuUGYd6sG+JMq+AoE7+Jlu0przk=
github.com/twinj/uuid v1.0.0/go.mod h1:mMgcE1RHFUFqe5AfiwlINXisXfDGro23fWdPUfOMjRY=
github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk=
github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ=
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
Expand Down Expand Up @@ -239,8 +237,6 @@ gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
gopkg.in/stretchr/testify.v1 v1.2.2 h1:yhQC6Uy5CqibAIlk1wlusa/MJ3iAN49/BsR/dCCKz3M=
gopkg.in/stretchr/testify.v1 v1.2.2/go.mod h1:QI5V/q6UbPmuhtm10CaFZxED9NreB8PnFYN9JcR6TxU=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
Loading