File tree 3 files changed +10
-1
lines changed
3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## v1.3.2
4
+ * Fixed checker for string slices.
5
+
3
6
## v1.3.1
4
7
* Moved ` conf.Options ` out of internal package.
5
8
Original file line number Diff line number Diff line change @@ -292,7 +292,9 @@ func (v *visitor) IndexNode(node *ast.IndexNode) reflect.Type {
292
292
func (v * visitor ) SliceNode (node * ast.SliceNode ) reflect.Type {
293
293
t := v .visit (node .Node )
294
294
295
- if _ , ok := indexType (t ); ok {
295
+ _ , isIndex := indexType (t )
296
+
297
+ if isIndex || isString (t ) {
296
298
if node .From != nil {
297
299
from := v .visit (node .From )
298
300
if ! isInteger (from ) {
Original file line number Diff line number Diff line change @@ -780,6 +780,10 @@ func TestExpr(t *testing.T) {
780
780
`Variadic("empty")` ,
781
781
[]int {},
782
782
},
783
+ {
784
+ `String[:3]` ,
785
+ "str" ,
786
+ },
783
787
}
784
788
785
789
for _ , tt := range tests {
You can’t perform that action at this time.
0 commit comments