Skip to content

Commit

Permalink
fix linting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
afeld committed Mar 31, 2017
1 parent 6b149e7 commit abc8767
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"sync"

"fmt"

"github.com/opencontrol/compliance-masonry/lib/common"
"github.com/opencontrol/compliance-masonry/lib/components"
)
Expand Down Expand Up @@ -72,7 +73,7 @@ func (ws *localWorkspace) LoadComponent(componentDir string) error {
if ws.components.compareAndAdd(component) {
ws.justifications.LoadMappings(component)
} else {
return fmt.Errorf("Component: %s exists!\n", component.GetKey())
return fmt.Errorf("component: %s exists", component.GetKey())
}
return nil
}
Expand Down
7 changes: 4 additions & 3 deletions lib/components_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package lib

import (
"path/filepath"
"testing"

"github.com/opencontrol/compliance-masonry/lib/common/mocks"
"github.com/opencontrol/compliance-masonry/lib/result"
"github.com/stretchr/testify/assert"
"path/filepath"
"testing"
)

func TestAddComponent(t *testing.T) {
Expand Down Expand Up @@ -56,7 +57,7 @@ func TestLoadSameComponentTwice(t *testing.T) {
err = ws.LoadComponent(componentPath)
// Should return an error that this component was already loaded.
assert.NotNil(t, err)
assert.Equal(t, "Component: EC2 exists!\n", err.Error())
assert.Equal(t, "component: EC2 exists", err.Error())
}

func TestBadLoadComponent(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion tools/fs/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ type OSUtil struct {
// OpenAndReadFile is a util that will check if the file exists, open and then read the file.
func (fs OSUtil) OpenAndReadFile(file string) ([]byte, error) {
if _, err := os.Stat(file); os.IsNotExist(err) {
return nil, fmt.Errorf("Error: %s does not exist\n", file)
return nil, fmt.Errorf("error: %s does not exist", file)
}
bytes, err := ioutil.ReadFile(file)
if err != nil {
Expand Down

0 comments on commit abc8767

Please sign in to comment.