Skip to content

Commit

Permalink
fixing golint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuf Kanchwala committed Jul 23, 2020
1 parent b00157b commit d56e25e
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pkg/cli/run.go
Expand Up @@ -10,5 +10,5 @@ func Run(iacType, iacVersion, cloudType, iacFilePath, iacDirPath string) {
// create a new runtime executor for processing IaC
executor := runtime.NewExecutor(iacType, iacVersion, cloudType, iacFilePath,
iacDirPath)
executor.Process()
executor.Execute()
}
6 changes: 3 additions & 3 deletions pkg/cloud-providers/aws/normalized.go
@@ -1,10 +1,10 @@
package awsProvider
package awsprovider

import (
"github.com/accurics/terrascan/pkg/iac-providers/output"
)

// CreateNormalizedJson creates a normalized json for the given input
func (a *AWSProvider) CreateNormalizedJson(allResourcesConfig output.AllResourceConfigs) (interface{}, error) {
// CreateNormalizedJSON creates a normalized json for the given input
func (a *AWSProvider) CreateNormalizedJSON(allResourcesConfig output.AllResourceConfigs) (interface{}, error) {
return allResourcesConfig, nil
}
3 changes: 2 additions & 1 deletion pkg/cloud-providers/aws/types.go
@@ -1,3 +1,4 @@
package awsProvider
package awsprovider

// AWSProvider implements cloud provider interface
type AWSProvider struct{}
2 changes: 1 addition & 1 deletion pkg/cloud-providers/cloud-provider.go
@@ -1,4 +1,4 @@
package cloudProvider
package cloudprovider

import (
"fmt"
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloud-providers/interface.go
@@ -1,4 +1,4 @@
package cloudProvider
package cloudprovider

import (
"github.com/accurics/terrascan/pkg/iac-providers/output"
Expand All @@ -7,5 +7,5 @@ import (
// CloudProvider defines the interface which every cloud provider needs to implement
// to claim support in terrascan
type CloudProvider interface {
CreateNormalizedJson(output.AllResourceConfigs) (interface{}, error)
CreateNormalizedJSON(output.AllResourceConfigs) (interface{}, error)
}
2 changes: 1 addition & 1 deletion pkg/cloud-providers/supported.go
@@ -1,4 +1,4 @@
package cloudProvider
package cloudprovider

import (
"reflect"
Expand Down
3 changes: 2 additions & 1 deletion pkg/http-server/start.go
@@ -1,11 +1,12 @@
package httpServer
package httpserver

import (
"net/http"

"go.uber.org/zap"
)

// Start starts the terrascan http server
func Start() {

zap.S().Info("terrascan server listening at port 9010")
Expand Down
2 changes: 1 addition & 1 deletion pkg/iac-providers/interface.go
@@ -1,4 +1,4 @@
package iacProvider
package iacprovider

import (
"github.com/accurics/terrascan/pkg/iac-providers/output"
Expand Down
2 changes: 1 addition & 1 deletion pkg/iac-providers/providers.go
@@ -1,4 +1,4 @@
package iacProvider
package iacprovider

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion pkg/iac-providers/supported.go
@@ -1,4 +1,4 @@
package iacProvider
package iacprovider

import (
"reflect"
Expand Down
1 change: 1 addition & 0 deletions pkg/logger/logger.go
Expand Up @@ -25,6 +25,7 @@ func getLoggerLevel(lvl string) zapcore.Level {
return zapcore.InfoLevel
}

// Init initializes global custom zap logger
func Init(encoding, level string) {

encodingLevel := zapcore.LowercaseColorLevelEncoder
Expand Down
6 changes: 3 additions & 3 deletions pkg/runtime/executor.go
Expand Up @@ -93,8 +93,8 @@ func (r *Executor) ValidateInputs() error {
return nil
}

// Process validates the inputs, processes the IaC, creates json output
func (r *Executor) Process() error {
// Execute validates the inputs, processes the IaC, creates json output
func (r *Executor) Execute() error {

// validate inputs
if err := r.ValidateInputs(); err != nil {
Expand Down Expand Up @@ -125,7 +125,7 @@ func (r *Executor) Process() error {
zap.S().Errorf("failed to create a new CloudProvider for cloudType '%s'. error: '%s'", r.cloudType, err)
return err
}
normalized, err := cloudProvider.CreateNormalizedJson(iacOut)
normalized, err := cloudProvider.CreateNormalizedJSON(iacOut)
if err != nil {
return err
}
Expand Down

0 comments on commit d56e25e

Please sign in to comment.