revel/revel#1057 addressing golint ALL_CAPS

This commit is contained in:
Jeevanandam M
2016-06-08 12:09:48 -07:00
parent e485de7e9c
commit 514b078c3d
6 changed files with 13 additions and 10 deletions

View File

@@ -4,11 +4,12 @@ import (
"bytes"
"errors"
"fmt"
"github.com/revel/revel"
"io"
"os"
"os/exec"
"time"
"github.com/revel/revel"
)
// App contains the configuration for running a Revel app. (Not for the app itself)

View File

@@ -419,7 +419,7 @@ func appendAction(fset *token.FileSet, mm methodMap, decl ast.Decl, pkgImportPat
if selExpr.Sel.Name != "Result" {
return
}
if pkgIdent, ok := selExpr.X.(*ast.Ident); !ok || imports[pkgIdent.Name] != revel.REVEL_IMPORT_PATH {
if pkgIdent, ok := selExpr.X.(*ast.Ident); !ok || imports[pkgIdent.Name] != revel.RevelImportPath {
return
}
@@ -597,7 +597,7 @@ func getValidationParameter(funcDecl *ast.FuncDecl, imports map[string]string) *
continue
}
if selExpr.Sel.Name == "Validation" && imports[xIdent.Name] == revel.REVEL_IMPORT_PATH {
if selExpr.Sel.Name == "Validation" && imports[xIdent.Name] == revel.RevelImportPath {
return field.Names[0].Obj
}
}
@@ -675,14 +675,14 @@ func (s *SourceInfo) TypesThatEmbed(targetType string) (filtered []*TypeInfo) {
func (s *SourceInfo) ControllerSpecs() []*TypeInfo {
if s.controllerSpecs == nil {
s.controllerSpecs = s.TypesThatEmbed(revel.REVEL_IMPORT_PATH + ".Controller")
s.controllerSpecs = s.TypesThatEmbed(revel.RevelImportPath + ".Controller")
}
return s.controllerSpecs
}
func (s *SourceInfo) TestSuites() []*TypeInfo {
if s.testSuites == nil {
s.testSuites = s.TypesThatEmbed(revel.REVEL_IMPORT_PATH + "/testing.TestSuite")
s.testSuites = s.TypesThatEmbed(revel.RevelImportPath + "/testing.TestSuite")
}
return s.testSuites
}

View File

@@ -1,7 +1,6 @@
package harness
import (
"github.com/revel/revel"
"go/ast"
"go/parser"
"go/token"
@@ -10,6 +9,8 @@ import (
"reflect"
"strings"
"testing"
"github.com/revel/revel"
)
const validationKeysSource = `
@@ -77,7 +78,7 @@ func TestGetValidationKeys(t *testing.T) {
}
for i, decl := range file.Decls {
lineKeys := getValidationKeys(fset, decl.(*ast.FuncDecl), map[string]string{"revel": revel.REVEL_IMPORT_PATH})
lineKeys := getValidationKeys(fset, decl.(*ast.FuncDecl), map[string]string{"revel": revel.RevelImportPath})
for k, v := range expectedValidationKeys[i] {
if lineKeys[k] != v {
t.Errorf("Not found - %d: %v - Actual Map: %v", k, v, lineKeys)