Skip to content

all: apply gofmt simplify #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compile/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ func (c *compiler) compileFunc(compilerScope compilerScopeType, Ast ast.Ast, Arg
c.makeClosure(newC.Code, args, newC, newC.qualname)

// Call decorators
for _ = range DecoratorList {
for range DecoratorList {
c.OpArg(vm.CALL_FUNCTION, 1) // 1 positional, 0 keyword pair
}
}
Expand Down Expand Up @@ -653,7 +653,7 @@ func (c *compiler) class(Ast ast.Ast, class *ast.ClassDef) {
c.callHelper(2, class.Bases, class.Keywords, class.Starargs, class.Kwargs)

/* 6. apply decorators */
for _ = range class.DecoratorList {
for range class.DecoratorList {
c.OpArg(vm.CALL_FUNCTION, 1) // 1 positional, 0 keyword pair
}

Expand Down
4 changes: 2 additions & 2 deletions parser/y.go
Original file line number Diff line number Diff line change
Expand Up @@ -1652,7 +1652,7 @@ yydefault:
case 130:
//line grammar.y:946
{
yyVAL.aliases = []*ast.Alias{&ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier("*")}}
yyVAL.aliases = []*ast.Alias{{Pos: yyVAL.pos, Name: ast.Identifier("*")}}
}
case 131:
//line grammar.y:950
Expand Down Expand Up @@ -2661,7 +2661,7 @@ yydefault:
yyVAL.call = &ast.Call{}
test := yyS[yypt-2].expr
if name, ok := test.(*ast.Name); ok {
yyVAL.call.Keywords = []*ast.Keyword{&ast.Keyword{Pos: name.Pos, Arg: name.Id, Value: yyS[yypt-0].expr}}
yyVAL.call.Keywords = []*ast.Keyword{{Pos: name.Pos, Arg: name.Id, Value: yyS[yypt-0].expr}}
} else {
yylex.(*yyLex).SyntaxError("keyword can't be an expression")
}
Expand Down
2 changes: 1 addition & 1 deletion py/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ func (a String) M__imod__(other Object) (Object, error) {
// returns end of string if not found
func (s String) pos(n int) int {
characterNumber := 0
for i, _ := range s {
for i := range s {
if characterNumber == n {
return i
}
Expand Down
2 changes: 1 addition & 1 deletion symtable/symtable_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func EqSymbols(t *testing.T, name string, a, b Symbols) {
t.Errorf("%s[%s] not found", name, ka)
}
}
for kb, _ := range b {
for kb := range b {
if _, ok := a[kb]; ok {
// Checked already
} else {
Expand Down
2 changes: 1 addition & 1 deletion time/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -998,7 +998,7 @@ func init() {
py.MustNewMethod("get_clock_info", time_get_clock_info, 0, get_clock_info_doc),
}
globals := py.StringDict{
//"version": py.Int(MARSHAL_VERSION),
//"version": py.Int(MARSHAL_VERSION),
}
py.NewModule("time", module_doc, methods, globals)

Expand Down