Skip to content

Commit 3d567cb

Browse files
authored
Merge pull request #85 from Teamwork/goutil-generics
Enhancement: Add support for generics in goutil.TagName
2 parents bed6cad + 4014bfd commit 3d567cb

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- name: Lint
1313
uses: golangci/golangci-lint-action@v6
1414
with:
15+
version: v1.64
1516
only-new-issues: true
1617

1718
test:

.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
run:
2-
deadline: 240s
2+
timeout: 240s
33
tests: true
44

55
linters:

goutil/goutil.go

+6
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,12 @@ start:
255255
return t.Name
256256
case *ast.SelectorExpr:
257257
return t.Sel.Name
258+
case *ast.IndexExpr:
259+
f = t.X
260+
goto start
261+
case *ast.IndexListExpr:
262+
f = t.X
263+
goto start
258264
default:
259265
panic(fmt.Sprintf("can't get name for %#v", f))
260266
}

0 commit comments

Comments
 (0)