Skip to content

Conversation

@rafaeljusto
Copy link
Contributor

@rafaeljusto rafaeljusto commented Feb 25, 2025

Fix an error raised when trying to extract a tag name from a generic type.

panic: can't get name for &ast.IndexExpr{X:(*ast.SelectorExpr)(0x40001cb6b0), Lbrack:4887, Index:(*ast.SelectorExpr)(0x40001cb6c8), Rbrack:4914}

goroutine 1 [running]:
github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil.getEmbedName({0x642200?, 0x400018c1e0?})
	/go/src/github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil/goutil.go:257 +0x108
github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil.TagName(0x4000001d40?, {0x559e40?, 0x5?})
	/go/src/github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil/goutil.go:224 +0x44
github.com/teamwork/kommentaar/docparse.GetReference(0x4000001d40, {0x559e40, 0x5}, 0x0, {0x40006f813a, 0x11}, {0x40001706e0, 0x50})
	/go/src/github.com/teamwork/kommentaar/docparse/find.go:440 +0x1088
github.com/teamwork/kommentaar/docparse.parseRefValue(0x4000001d40, {0x559e40, 0x5}, {0x40006f813a, 0x11}, {0x40001706e0, 0x50})
	/go/src/github.com/teamwork/kommentaar/docparse/docparse.go:501 +0xc0
github.com/teamwork/kommentaar/docparse.parseComment(0x4000001d40, {0x40006f8000, 0x1c1}, {0x0?, 0x0?}, {0x40001706e0, 0x50})
	/go/src/github.com/teamwork/kommentaar/docparse/docparse.go:274 +0x570
github.com/teamwork/kommentaar/docparse.FindComments({0x63e820, 0x400004a060}, 0x4000001d40)
	/go/src/github.com/teamwork/kommentaar/docparse/find.go:49 +0x448
main.start()
	/go/src/github.com/teamwork/kommentaar/main.go:91 +0x4f0
main.main()
	/go/src/github.com/teamwork/kommentaar/main.go:23 +0x48

Related to:
Teamwork/utils#85

Fix an error raised when trying to extract a tag name from a generic type.

```
panic: can't get name for &ast.IndexExpr{X:(*ast.SelectorExpr)(0x40001cb6b0), Lbrack:4887, Index:(*ast.SelectorExpr)(0x40001cb6c8), Rbrack:4914}

goroutine 1 [running]:
github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil.getEmbedName({0x642200?, 0x400018c1e0?})
	/go/src/github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil/goutil.go:257 +0x108
github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil.TagName(0x4000001d40?, {0x559e40?, 0x5?})
	/go/src/github.com/teamwork/kommentaar/vendor/github.com/teamwork/utils/v2/goutil/goutil.go:224 +0x44
github.com/teamwork/kommentaar/docparse.GetReference(0x4000001d40, {0x559e40, 0x5}, 0x0, {0x40006f813a, 0x11}, {0x40001706e0, 0x50})
	/go/src/github.com/teamwork/kommentaar/docparse/find.go:440 +0x1088
github.com/teamwork/kommentaar/docparse.parseRefValue(0x4000001d40, {0x559e40, 0x5}, {0x40006f813a, 0x11}, {0x40001706e0, 0x50})
	/go/src/github.com/teamwork/kommentaar/docparse/docparse.go:501 +0xc0
github.com/teamwork/kommentaar/docparse.parseComment(0x4000001d40, {0x40006f8000, 0x1c1}, {0x0?, 0x0?}, {0x40001706e0, 0x50})
	/go/src/github.com/teamwork/kommentaar/docparse/docparse.go:274 +0x570
github.com/teamwork/kommentaar/docparse.FindComments({0x63e820, 0x400004a060}, 0x4000001d40)
	/go/src/github.com/teamwork/kommentaar/docparse/find.go:49 +0x448
main.start()
	/go/src/github.com/teamwork/kommentaar/main.go:91 +0x4f0
main.main()
	/go/src/github.com/teamwork/kommentaar/main.go:23 +0x48
```
@rafaeljusto rafaeljusto requested a review from a team February 25, 2025 11:29
@coveralls
Copy link

Pull Request Test Coverage Report for Build 13520171905

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 55.116%

Totals Coverage Status
Change from base Build 13519282486: 0.0%
Covered Lines: 1115
Relevant Lines: 2023

💛 - Coveralls

@rafaeljusto rafaeljusto merged commit 948470d into master Feb 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants