Skip to content

Commit

Permalink
style: format code with Gofumpt and Prettier
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 8d61bf1 according to the output
from Gofumpt and Prettier.

Details: #2769
  • Loading branch information
deepsource-autofix[bot] authored Dec 8, 2024
1 parent 8d61bf1 commit 461e063
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions hack/docker/gen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import (
"github.com/vdaas/vald/internal/log"
"github.com/vdaas/vald/internal/safety"
"github.com/vdaas/vald/internal/strings"
"github.com/vdaas/vald/internal/sync/errgroup"
"github.com/vdaas/vald/internal/sync"
"github.com/vdaas/vald/internal/sync/errgroup"
"golang.org/x/tools/go/packages"
"gopkg.in/yaml.v2"
)
Expand Down Expand Up @@ -914,7 +914,7 @@ func main() {
}
slices.Sort(pkgs)
pkgs = slices.Compact(pkgs)
for i, pkg := range pkgs{
for i, pkg := range pkgs {
pkg = file.Join(pkg, "/*.go")
_, right, ok := strings.Cut(pkg, "/vdaas/vald/")
if ok && right != "" {
Expand Down Expand Up @@ -1171,8 +1171,8 @@ type PackageNode struct {
}

// ToSlice traverses the dependency tree and returns all dependencies as a slice.
func (n PackageNode) ToSlice() (pkgs []string){
pkgs = make([]string, 0, len(n.Imports) + 1)
func (n PackageNode) ToSlice() (pkgs []string) {
pkgs = make([]string, 0, len(n.Imports)+1)
if n.Name != "command-line-arguments" {
pkgs = append(pkgs, n.Name)
}
Expand All @@ -1190,7 +1190,7 @@ func (n PackageNode) String() string {
func (n PackageNode) string(depth int) (tree string) {
tree = fmt.Sprintf("%s- %s\n", strings.Repeat(" ", depth), n.Name)
for _, node := range n.Imports {
tree += node.string(depth+1)
tree += node.string(depth + 1)
}
return tree
}
Expand All @@ -1208,9 +1208,9 @@ func processDependencies(pkg *packages.Package, nodes map[string]*PackageNode, m
nodes[pkg.PkgPath] = node
checkList[pkg.PkgPath] = node
for _, imp := range pkg.Imports {
if !strings.Contains(imp.PkgPath, "vdaas/vald") {
if !strings.Contains(imp.PkgPath, "vdaas/vald") {
continue
}
}
if child, exists := checkList[imp.PkgPath]; exists {
node.Imports = append(node.Imports, child)
continue
Expand Down

0 comments on commit 461e063

Please sign in to comment.