Unverified Commit 14f051ef authored by Brice Rising's avatar Brice Rising Committed by Matt Farina

Fix style issues

Our style settings don't like underscores in variable names, so I switched to camel case. Also, err was unused in some places, so I made an error a fail condition for some test.
Signed-off-by: 's avatarBrice Rising <brice.rising@slalom.com>
(cherry picked from commit 3d15ec7125bff4a43f4da57225c88c086cbdf108)
parent 4b9efedf
...@@ -148,9 +148,13 @@ func TestCopyDirFail_SrcInaccessible(t *testing.T) { ...@@ -148,9 +148,13 @@ func TestCopyDirFail_SrcInaccessible(t *testing.T) {
t.Skip("skipping on windows") t.Skip("skipping on windows")
} }
var current_user, err = user.Current() var currentUser, err = user.Current()
if current_user.Name == "root" { if err != nil {
t.Fatalf("Failed to get name of current user: %s", err)
}
if currentUser.Name == "root" {
// Skipping if root, because all files are accessible // Skipping if root, because all files are accessible
t.Skip("Skipping for root user") t.Skip("Skipping for root user")
} }
...@@ -183,9 +187,13 @@ func TestCopyDirFail_DstInaccessible(t *testing.T) { ...@@ -183,9 +187,13 @@ func TestCopyDirFail_DstInaccessible(t *testing.T) {
t.Skip("skipping on windows") t.Skip("skipping on windows")
} }
var current_user, err = user.Current() var currentUser, err = user.Current()
if current_user.Name == "root" { if err != nil {
t.Fatalf("Failed to get name of current user: %s", err)
}
if currentUser.Name == "root" {
// Skipping if root, because all files are accessible // Skipping if root, because all files are accessible
t.Skip("Skipping for root user") t.Skip("Skipping for root user")
} }
...@@ -279,9 +287,13 @@ func TestCopyDirFailOpen(t *testing.T) { ...@@ -279,9 +287,13 @@ func TestCopyDirFailOpen(t *testing.T) {
t.Skip("skipping on windows") t.Skip("skipping on windows")
} }
var current_user, err = user.Current() var currentUser, err = user.Current()
if err != nil {
t.Fatalf("Failed to get name of current user: %s", err)
}
if current_user.Name == "root" { if currentUser.Name == "root" {
// Skipping if root, because all files are accessible // Skipping if root, because all files are accessible
t.Skip("Skipping for root user") t.Skip("Skipping for root user")
} }
...@@ -444,9 +456,13 @@ func TestCopyFileFail(t *testing.T) { ...@@ -444,9 +456,13 @@ func TestCopyFileFail(t *testing.T) {
t.Skip("skipping on windows") t.Skip("skipping on windows")
} }
var current_user, err = user.Current() var currentUser, err = user.Current()
if current_user.Name == "root" { if err != nil {
t.Fatalf("Failed to get name of current user: %s", err)
}
if currentUser.Name == "root" {
// Skipping if root, because all files are accessible // Skipping if root, because all files are accessible
t.Skip("Skipping for root user") t.Skip("Skipping for root user")
} }
...@@ -531,9 +547,13 @@ func setupInaccessibleDir(t *testing.T, op func(dir string) error) func() { ...@@ -531,9 +547,13 @@ func setupInaccessibleDir(t *testing.T, op func(dir string) error) func() {
func TestIsDir(t *testing.T) { func TestIsDir(t *testing.T) {
var current_user, err = user.Current() var currentUser, err = user.Current()
if current_user.Name == "root" { if err != nil {
t.Fatalf("Failed to get name of current user: %s", err)
}
if currentUser.Name == "root" {
// Skipping if root, because all files are accessible // Skipping if root, because all files are accessible
t.Skip("Skipping for root user") t.Skip("Skipping for root user")
} }
...@@ -584,9 +604,13 @@ func TestIsDir(t *testing.T) { ...@@ -584,9 +604,13 @@ func TestIsDir(t *testing.T) {
func TestIsSymlink(t *testing.T) { func TestIsSymlink(t *testing.T) {
var current_user, err = user.Current() var currentUser, err = user.Current()
if err != nil {
t.Fatalf("Failed to get name of current user: %s", err)
}
if current_user.Name == "root" { if currentUser.Name == "root" {
// Skipping if root, because all files are accessible // Skipping if root, because all files are accessible
t.Skip("Skipping for root user") t.Skip("Skipping for root user")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment