move tree/ to rootfs/

This commit is contained in:
Motiejus Jakštys 2021-05-24 00:11:58 +03:00
parent b76a500f2e
commit 8dedaebcf7
5 changed files with 11 additions and 26 deletions

View File

@ -1,15 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
go_library(
name = "go_default_library",
srcs = ["tree.go"],
importpath = "github.com/motiejus/code/undocker/internal/tree",
visibility = ["//src:__subpackages__"],
)
go_test(
name = "go_default_test",
srcs = ["tree_test.go"],
embed = [":go_default_library"],
deps = ["@com_github_stretchr_testify//assert:go_default_library"],
)

View File

@ -5,18 +5,19 @@ go_library(
srcs = [
"doc.go",
"rootfs.go",
"tree.go",
],
importpath = "github.com/motiejus/code/undocker/rootfs",
visibility = ["//visibility:public"],
deps = [
"//src/undocker/internal/tree:go_default_library",
"@org_uber_go_multierr//:go_default_library",
],
deps = ["@org_uber_go_multierr//:go_default_library"],
)
go_test(
name = "go_default_test",
srcs = ["rootfs_test.go"],
srcs = [
"rootfs_test.go",
"tree_test.go",
],
embed = [":go_default_library"],
deps = [
"@com_github_stretchr_testify//assert:go_default_library",

View File

@ -9,7 +9,6 @@ import (
"path/filepath"
"strings"
"github.com/motiejus/code/undocker/internal/tree"
"go.uber.org/multierr"
)
@ -194,10 +193,10 @@ func writeFile(tr *tar.Reader, tw *tar.Writer, hdr *tar.Header) error {
return nil
}
func whiteoutDirs(whreaddir map[string]int, nlayers int) []*tree.Tree {
ret := make([]*tree.Tree, nlayers)
func whiteoutDirs(whreaddir map[string]int, nlayers int) []*Tree {
ret := make([]*Tree, nlayers)
for i := range ret {
ret[i] = tree.New()
ret[i] = New()
}
for fname, layer := range whreaddir {
if layer == 0 {

View File

@ -1,4 +1,4 @@
package tree
package rootfs
import (
"path/filepath"

View File

@ -1,4 +1,4 @@
package tree
package rootfs
import (
"testing"