From 4ab44bff01b0b2e0dbf0816689efdc3c59f197c9 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Tue, 24 Oct 2023 09:06:29 -0400 Subject: [PATCH] *.go: `goimports -w .`` Signed-off-by: Vincent Batts --- compare.go | 3 ++- tar.go | 11 +++++++---- tar_test.go | 2 ++ xattr/xattr.go | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/compare.go b/compare.go index 816eb06..29da1ab 100644 --- a/compare.go +++ b/compare.go @@ -459,7 +459,8 @@ func compare(oldDh, newDh *DirectoryHierarchy, keys []Keyword, same bool) ([]Ino // InodeDeltas. // // NB: The order of the parameters matters (old, new) because Extra and -// Missing are considered as different discrepancy types. +// +// Missing are considered as different discrepancy types. func Compare(oldDh, newDh *DirectoryHierarchy, keys []Keyword) ([]InodeDelta, error) { return compare(oldDh, newDh, keys, false) } diff --git a/tar.go b/tar.go index dcef122..c3f3093 100644 --- a/tar.go +++ b/tar.go @@ -229,8 +229,9 @@ hdrloop: // appropriate position in the tree. If not, create a path up until the Entry's // directory that it is contained in. Then, insert the Entry. // root: the "." Entry -// e: the Entry we are looking to insert -// hdr: the tar header struct associated with e +// +// e: the Entry we are looking to insert +// hdr: the tar header struct associated with e func populateTree(root, e *Entry, hdr *tar.Header) error { if root == nil || e == nil { return fmt.Errorf("cannot populate or insert nil Entry's") @@ -295,8 +296,10 @@ func populateTree(root, e *Entry, hdr *tar.Header) error { // After constructing a pseudo file hierarchy tree, we want to "flatten" this // tree by putting the Entries into a slice with appropriate positioning. -// root: the "head" of the sub-tree to flatten -// creator: a dhCreator that helps with the '/set' keyword +// +// root: the "head" of the sub-tree to flatten +// creator: a dhCreator that helps with the '/set' keyword +// // keywords: keywords specified by the user that should be evaluated func flatten(root *Entry, creator *dhCreator, keywords []Keyword) { if root == nil || creator == nil { diff --git a/tar_test.go b/tar_test.go index 3725821..d004b72 100644 --- a/tar_test.go +++ b/tar_test.go @@ -128,6 +128,7 @@ func TestTar(t *testing.T) { // `tar -cvf some.tar dir1 dir2 dir3 dir4/dir5 dir6` ... etc. // The testdata of collection.tar resemble such an archive. the `collection` folder // is the contents of `collection.tar` extracted +// //gocyclo:ignore func TestArchiveCreation(t *testing.T) { fh, err := os.Open("./testdata/collection.tar") @@ -197,6 +198,7 @@ func TestArchiveCreation(t *testing.T) { // evaluated. Also, The fact that this archive contains a single entry, yet the // entry is associated with a file that has parent directories, means that the // "." directory should be the lowest sub-directory under which `file` is contained. +// //gocyclo:ignore func TestTreeTraversal(t *testing.T) { fh, err := os.Open("./testdata/traversal.tar") diff --git a/xattr/xattr.go b/xattr/xattr.go index d6ad9ce..832c679 100644 --- a/xattr/xattr.go +++ b/xattr/xattr.go @@ -1,3 +1,4 @@ +//go:build linux // +build linux package xattr