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 = [ srcs = [
"doc.go", "doc.go",
"rootfs.go", "rootfs.go",
"tree.go",
], ],
importpath = "github.com/motiejus/code/undocker/rootfs", importpath = "github.com/motiejus/code/undocker/rootfs",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = ["@org_uber_go_multierr//:go_default_library"],
"//src/undocker/internal/tree:go_default_library",
"@org_uber_go_multierr//:go_default_library",
],
) )
go_test( go_test(
name = "go_default_test", name = "go_default_test",
srcs = ["rootfs_test.go"], srcs = [
"rootfs_test.go",
"tree_test.go",
],
embed = [":go_default_library"], embed = [":go_default_library"],
deps = [ deps = [
"@com_github_stretchr_testify//assert:go_default_library", "@com_github_stretchr_testify//assert:go_default_library",

View File

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

View File

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

View File

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