fix Makefile, run gofmt on the all go files

This commit is contained in:
z7zmey 2018-02-19 13:00:58 +02:00
parent 757f57c223
commit 014b0576d6
22 changed files with 67 additions and 78 deletions

View File

@ -3,7 +3,7 @@ PHPFILE=example.php
all: compile run all: compile run
build: build:
gofmt -l -s -w **/*.go find . -type f -iregex '.*\.go' -exec gofmt -l -s -w '{}' +
go build go build
run: build run: build

View File

@ -45,7 +45,6 @@ func TestAltIf(t *testing.T) {
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }
@ -75,7 +74,6 @@ func TestAltElseIf(t *testing.T) {
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }
@ -102,7 +100,6 @@ func TestAltElse(t *testing.T) {
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }
@ -141,7 +138,6 @@ func TestAltElseElseIf(t *testing.T) {
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }

View File

@ -76,7 +76,6 @@ func TestClassConstListWithoutModifiers(t *testing.T) {
actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ := php7.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php") actual, _, _ = php5.Parse(bytes.NewBufferString(src), "test.php")
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }

View File

@ -1,8 +1,8 @@
package stmt_test package stmt_test
import ( import (
"github.com/z7zmey/php-parser/node/name"
"bytes" "bytes"
"github.com/z7zmey/php-parser/node/name"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"

View File

@ -1,9 +1,9 @@
package stmt_test package stmt_test
import ( import (
"bytes"
"github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr"
"github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/name"
"bytes"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"

View File

@ -1,4 +1,3 @@
package stmt_test package stmt_test
import ( import (

View File

@ -1,4 +1,3 @@
package stmt_test package stmt_test
import ( import (

View File

@ -1,9 +1,8 @@
package stmt_test package stmt_test
import ( import (
"github.com/z7zmey/php-parser/node/name"
"bytes" "bytes"
"github.com/z7zmey/php-parser/node/name"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"

View File

@ -1,8 +1,8 @@
package stmt_test package stmt_test
import ( import (
"github.com/z7zmey/php-parser/node/name"
"bytes" "bytes"
"github.com/z7zmey/php-parser/node/name"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
@ -56,7 +56,6 @@ func TestNamespaceStmts(t *testing.T) {
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }
func TestAnonymousNamespace(t *testing.T) { func TestAnonymousNamespace(t *testing.T) {
src := `<? namespace {}` src := `<? namespace {}`

View File

@ -1,9 +1,9 @@
package stmt_test package stmt_test
import ( import (
"github.com/z7zmey/php-parser/node/scalar"
"github.com/z7zmey/php-parser/node/expr"
"bytes" "bytes"
"github.com/z7zmey/php-parser/node/expr"
"github.com/z7zmey/php-parser/node/scalar"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"

View File

@ -1,8 +1,8 @@
package stmt_test package stmt_test
import ( import (
"github.com/z7zmey/php-parser/node/name"
"bytes" "bytes"
"github.com/z7zmey/php-parser/node/name"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"

View File

@ -1,9 +1,9 @@
package stmt_test package stmt_test
import ( import (
"bytes"
"github.com/z7zmey/php-parser/node/expr" "github.com/z7zmey/php-parser/node/expr"
"github.com/z7zmey/php-parser/node/name" "github.com/z7zmey/php-parser/node/name"
"bytes"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"

View File

@ -1,8 +1,8 @@
package stmt_test package stmt_test
import ( import (
"github.com/z7zmey/php-parser/node/name"
"bytes" "bytes"
"github.com/z7zmey/php-parser/node/name"
"testing" "testing"
"github.com/z7zmey/php-parser/node" "github.com/z7zmey/php-parser/node"
@ -297,7 +297,6 @@ func TestUseListConstTypeAliases(t *testing.T) {
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }
func TestGroupUse(t *testing.T) { func TestGroupUse(t *testing.T) {
src := `<? use Foo\{Bar, Baz};` src := `<? use Foo\{Bar, Baz};`
@ -441,7 +440,6 @@ func TestConstGroupUse(t *testing.T) {
assertEqual(t, expected, actual) assertEqual(t, expected, actual)
} }
func TestMixedGroupUse(t *testing.T) { func TestMixedGroupUse(t *testing.T) {
src := `<? use Foo\{const Bar, function Baz};` src := `<? use Foo\{const Bar, function Baz};`