Skip to content

go/analysis: fix vet errors #164

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions go/analysis/internal/facts/facts.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (s *Set) AllObjectFacts(filter map[reflect.Type]bool) []analysis.ObjectFact
var facts []analysis.ObjectFact
for k, v := range s.m {
if k.obj != nil && filter[k.t] {
facts = append(facts, analysis.ObjectFact{k.obj, v})
facts = append(facts, analysis.ObjectFact{Object: k.obj, Fact: v})
}
}
return facts
Expand Down Expand Up @@ -136,7 +136,7 @@ func (s *Set) AllPackageFacts(filter map[reflect.Type]bool) []analysis.PackageFa
var facts []analysis.PackageFact
for k, v := range s.m {
if k.obj == nil && filter[k.t] {
facts = append(facts, analysis.PackageFact{k.pkg, v})
facts = append(facts, analysis.PackageFact{Package: k.pkg, Fact: v})
}
}
return facts
Expand Down
4 changes: 3 additions & 1 deletion go/analysis/passes/assign/assign.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ func run(pass *analysis.Pass) (interface{}, error) {
pass.Report(analysis.Diagnostic{
Pos: stmt.Pos(), Message: fmt.Sprintf("self-assignment of %s to %s", re, le),
SuggestedFixes: []analysis.SuggestedFix{
{Message: "Remove", TextEdits: []analysis.TextEdit{{stmt.Pos(), stmt.End(), []byte{}}}},
{Message: "Remove", TextEdits: []analysis.TextEdit{
{Pos: stmt.Pos(), End: stmt.End(), NewText: []byte{}},
}},
},
})
}
Expand Down