diff --git a/consts.go b/consts.go index 7425009..cd99fdf 100644 --- a/consts.go +++ b/consts.go @@ -35,7 +35,12 @@ func (c *ConstsValidator) Validate(v *ast.GenDecl, fset *token.FileSet) error { } for _, vss := range s.Values { - _, ok := vss.(*ast.Ident) + bexpr, ok := vss.(*ast.BinaryExpr) + if ok { + vss = bexpr.Y + } + + _, ok = vss.(*ast.Ident) if ok { return nil // iota } diff --git a/testdata/consts_iota.go b/testdata/consts_iota.go index a4e82c6..68c8fa7 100644 --- a/testdata/consts_iota.go +++ b/testdata/consts_iota.go @@ -4,5 +4,6 @@ const ( Bla = "iota" Consts_iota = iota Consts_iota2 = iota + 1 + Consts_iota0 = 1 << iota Consts_iota1 )