Skip to content

Commit

Permalink
Merge pull request #3 from qoke/patch-1
Browse files Browse the repository at this point in the history
Check for nil Names before addressing slice
  • Loading branch information
srikrsna authored Jun 20, 2019
2 parents 38086bf + da81c7e commit a39b1bd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions module/replace.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ func (v retag) Visit(n ast.Node) ast.Visitor {
}

if f, ok := n.(*ast.Field); ok {
if len(f.Names) == 0 {
return nil
}
newTags := v.tags[f.Names[0].String()]
if newTags == nil {
return nil
Expand Down

0 comments on commit a39b1bd

Please sign in to comment.