Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix err.String() to err.Error()

  • Loading branch information...
commit 14931d472542e260d9d985d8d8ea178ed3d2ffff 1 parent f7ffa7c
@PuerkitoBio PuerkitoBio authored committed
Showing with 10 additions and 9 deletions.
  1. +2 −1  .gitignore
  2. +8 −8 robotstxt_test.go
View
3  .gitignore
@@ -7,4 +7,5 @@ _cgo_*
_obj
_test
6.out
-
+*.sublime-*
+.DS_Store
View
16 robotstxt_test.go
@@ -170,11 +170,11 @@ const robots_text_003 = "User-Agent: * \nAllow: /"
func TestFromString007(t *testing.T) {
r, err := FromString(robots_text_003, true)
if err != nil {
- t.Fatal(err.String())
+ t.Fatal(err.Error())
}
- allow, err1 := r.TestAgent("/random", "SomeBot")
- if err1 != nil {
- t.Fatal(err1.String())
+ allow, err := r.TestAgent("/random", "SomeBot")
+ if err != nil {
+ t.Fatal(err.Error())
}
if !allow {
t.Fatal("Must allow.")
@@ -186,11 +186,11 @@ const robots_text_004 = "User-Agent: * \nDisallow: "
func TestFromString008(t *testing.T) {
r, err := FromString(robots_text_004, true)
if err != nil {
- t.Fatal(err.String())
+ t.Fatal(err.Error())
}
- allow, err1 := r.TestAgent("/random", "SomeBot")
- if err1 != nil {
- t.Fatal(err1.String())
+ allow, err := r.TestAgent("/random", "SomeBot")
+ if err != nil {
+ t.Fatal(err.Error())
}
if !allow {
t.Fatal("Must allow.")
Please sign in to comment.
Something went wrong with that request. Please try again.