Spaces to tabs (gofmt) files

This commit is contained in:
NotZippy
2017-05-03 15:56:37 -07:00
parent 49041fb83d
commit 18e6b92704
3 changed files with 18 additions and 20 deletions

View File

@@ -160,21 +160,20 @@ func ProcessSource(roots []string) (*SourceInfo, *revel.Error) {
return nil return nil
} }
// Ignore packages that end with _test // Ignore packages that end with _test
for i := range pkgs { for i := range pkgs {
if len(i)>6 { if len(i) > 6 {
if string(i[len(i) - 5:]) == "_test" { if string(i[len(i)-5:]) == "_test" {
delete(pkgs, i) delete(pkgs, i)
} }
} }
} }
// There should be only one package in this directory. // There should be only one package in this directory.
if len(pkgs) > 1 { if len(pkgs) > 1 {
for i := range pkgs { for i := range pkgs {
println("Found package ",i) println("Found package ", i)
} }
log.Println("Most unexpected! Multiple packages in a single directory:", pkgs) log.Println("Most unexpected! Multiple packages in a single directory:", pkgs)
} }

View File

@@ -89,12 +89,12 @@ func parseRunArgs(args []string) *RunArgs {
// 1. revel run [import-path] // 1. revel run [import-path]
// 2. revel run [port] // 2. revel run [port]
// 3. revel run [run-mode] // 3. revel run [run-mode]
_, err := build.Import(args[0], "", build.FindOnly); _, err := build.Import(args[0], "", build.FindOnly)
if err!=nil { if err != nil {
revel.WARN.Printf("Unable to run using an import path, assuming import path is working directory %s %s",args[0],err.Error()) revel.WARN.Printf("Unable to run using an import path, assuming import path is working directory %s %s", args[0], err.Error())
} }
println("Trying to build with",args[0], err) println("Trying to build with", args[0], err)
if err == nil { if err == nil {
// 1st arg is the import path // 1st arg is the import path
inputArgs.ImportPath = args[0] inputArgs.ImportPath = args[0]
} else if port, err := strconv.Atoi(args[0]); err == nil { } else if port, err := strconv.Atoi(args[0]); err == nil {

View File

@@ -29,7 +29,6 @@ func init() {
revel.ActionInvoker, // Invoke the action. revel.ActionInvoker, // Invoke the action.
} }
// register startup functions with OnAppStart // register startup functions with OnAppStart
// revel.DevMode and revel.RunMode only work inside of OnAppStart. See Example Startup Script // revel.DevMode and revel.RunMode only work inside of OnAppStart. See Example Startup Script
// ( order dependent ) // ( order dependent )
@@ -45,7 +44,7 @@ func init() {
var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) { var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
c.Response.SetHttpHeader("X-Frame-Options", "SAMEORIGIN") c.Response.SetHttpHeader("X-Frame-Options", "SAMEORIGIN")
c.Response.SetHttpHeader("X-XSS-Protection", "1; mode=block") c.Response.SetHttpHeader("X-XSS-Protection", "1; mode=block")
c.Response.SetHttpHeader( "X-Content-Type-Options", "nosniff") c.Response.SetHttpHeader("X-Content-Type-Options", "nosniff")
fc[0](c, fc[1:]) // Execute the next filter stage. fc[0](c, fc[1:]) // Execute the next filter stage.
} }