Skip to content

Commit

Permalink
presentations: add slides for florence
Browse files Browse the repository at this point in the history
  • Loading branch information
matloob committed Oct 21, 2019
1 parent 3adb903 commit cce070d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions cmpequal/cmpequal.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ func run(pass *analysis.Pass) (interface{}, error) {
if !types.Identical(typ0, typ1) {
var fixes []analysis.SuggestedFix
if isPointerTo(typ0, typ1) {
fixes = fixDereference(pass, call.Args[0])
fixes = fixDereference(pass, call.Args[0])
} else if isPointerTo(typ1, typ0) {
fixes = fixDereference(pass, call.Args[1])
}
reportWithFixes(pass, call, fixes, "cmp.Equal's arguments must have the same type; is called with %s and %s",typeName(typ0), typeName(typ1))
reportWithFixes(pass, call, fixes, "\n cmp.Equal's arguments must have the same type\n"+
" but it's called with \u001b[31m%s\u001b[0m and \u001b[31m%s\u001b[0m values", typeName(typ0), typeName(typ1))
}
}
inspect.Preorder(
Expand Down
6 changes: 3 additions & 3 deletions cmpequal/testdata/src/a/a.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Package a is a good package.
package a

import (
"fmt"
"testing"

"github.com/google/go-cmp/cmp"
Expand All @@ -17,7 +17,7 @@ func NewX() *X {
func TestSomething(t *testing.T) {
want := X{}
got := NewX()
if !cmp.Equal(got, want) { // error or something
fmt.Println("but they're not equal!")
if !cmp.Equal(got, want) {
t.Error("but they're not equal!")
}
}
Binary file added presentations/florence.key
Binary file not shown.
Binary file modified presentations/london.key
Binary file not shown.
Binary file modified presentations/tokyo.key
Binary file not shown.

0 comments on commit cce070d

Please sign in to comment.