diff --git a/hack/docker/gen/main.go b/hack/docker/gen/main.go index 8549ff4c150..88c4a4a9134 100644 --- a/hack/docker/gen/main.go +++ b/hack/docker/gen/main.go @@ -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" ) @@ -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 != "" { @@ -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) } @@ -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 } @@ -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