Skip to content

Commit 6a2b593

Browse files
committed
all: apply gofmt simplify
1 parent 16e9ec3 commit 6a2b593

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

compile/compile.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ func (c *compiler) compileFunc(compilerScope compilerScopeType, Ast ast.Ast, Arg
604604
c.makeClosure(newC.Code, args, newC, newC.qualname)
605605

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

655655
/* 6. apply decorators */
656-
for _ = range class.DecoratorList {
656+
for range class.DecoratorList {
657657
c.OpArg(vm.CALL_FUNCTION, 1) // 1 positional, 0 keyword pair
658658
}
659659

parser/y.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ yydefault:
16521652
case 130:
16531653
//line grammar.y:946
16541654
{
1655-
yyVAL.aliases = []*ast.Alias{&ast.Alias{Pos: yyVAL.pos, Name: ast.Identifier("*")}}
1655+
yyVAL.aliases = []*ast.Alias{{Pos: yyVAL.pos, Name: ast.Identifier("*")}}
16561656
}
16571657
case 131:
16581658
//line grammar.y:950
@@ -2661,7 +2661,7 @@ yydefault:
26612661
yyVAL.call = &ast.Call{}
26622662
test := yyS[yypt-2].expr
26632663
if name, ok := test.(*ast.Name); ok {
2664-
yyVAL.call.Keywords = []*ast.Keyword{&ast.Keyword{Pos: name.Pos, Arg: name.Id, Value: yyS[yypt-0].expr}}
2664+
yyVAL.call.Keywords = []*ast.Keyword{{Pos: name.Pos, Arg: name.Id, Value: yyS[yypt-0].expr}}
26652665
} else {
26662666
yylex.(*yyLex).SyntaxError("keyword can't be an expression")
26672667
}

py/string.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ func (a String) M__imod__(other Object) (Object, error) {
388388
// returns end of string if not found
389389
func (s String) pos(n int) int {
390390
characterNumber := 0
391-
for i, _ := range s {
391+
for i := range s {
392392
if characterNumber == n {
393393
return i
394394
}

symtable/symtable_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ func EqSymbols(t *testing.T, name string, a, b Symbols) {
7272
t.Errorf("%s[%s] not found", name, ka)
7373
}
7474
}
75-
for kb, _ := range b {
75+
for kb := range b {
7676
if _, ok := a[kb]; ok {
7777
// Checked already
7878
} else {

time/time.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ func init() {
998998
py.MustNewMethod("get_clock_info", time_get_clock_info, 0, get_clock_info_doc),
999999
}
10001000
globals := py.StringDict{
1001-
//"version": py.Int(MARSHAL_VERSION),
1001+
//"version": py.Int(MARSHAL_VERSION),
10021002
}
10031003
py.NewModule("time", module_doc, methods, globals)
10041004

0 commit comments

Comments
 (0)