Skip to content

Commit 9dee6bd

Browse files
committed
chore: add comments
1 parent 015671e commit 9dee6bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

nilerr.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,16 @@ func run(pass *analysis.Pass) (any, error) {
6767
return nil, nil
6868
}
6969

70+
// getValueLineNumbers returns the line numbers.
71+
// `seen` is used to avoid infinite loop.
7072
func getValueLineNumbers(pass *analysis.Pass, v ssa.Value, seen map[string]struct{}) []int {
7173
if phi, ok := v.(*ssa.Phi); ok {
7274
result := make([]int, 0, len(phi.Edges))
7375

7476
for _, edge := range phi.Edges {
7577
if _, ok := seen[edge.Name()]; ok {
7678
if edge.Pos() == token.NoPos {
79+
// Skip elements without a position.
7780
continue
7881
}
7982

0 commit comments

Comments
 (0)